1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.admin;
17
18 import org.junit.Test;
19
20
21
22
23
24 public abstract class AdminTmplMthdAftNavBlanketAppBase extends AdminTmplMthdAftNavCreateNewBase {
25
26 @Override
27 protected String getMenuLinkLocator() {
28 return AdminTmplMthdAftNavBase.ADMIN_LOCATOR;
29 }
30
31 @Override
32 protected String getCreateNewLinkLocator() {
33 return AdminTmplMthdAftNavBase.CREATE_NEW_LOCATOR;
34 }
35
36 protected String testBlanketApprove() throws Exception {
37 selectFrameIframePortlet();
38 waitAndCreateNew();
39 String docId = verifyDocInitiated();
40 assertBlanketApproveButtonsPresent();
41 createNewLookupDetails();
42
43 jGrowl("Click Blanket Approve");
44 waitAndClickByName(BLANKET_APPROVE_NAME,
45 "No blanket approve button does the user " + getUserName() + " have permission?");
46 Thread.sleep(2000);
47
48 int attempts = 0;
49 while (hasDocError() && extractErrorText().contains("a record with the same primary key already exists.") &&
50 ++attempts <= 3) {
51 uniqueString = null;
52 jGrowl("record with the same primary key already exists");
53 createNewEnterDetails();
54 jGrowl("Click Blanket Approve");
55 waitAndClickByName(BLANKET_APPROVE_NAME,
56 "No blanket approve button does the user " + getUserName() + " have permission?");
57 }
58
59 checkForIncidentReport();
60 blanketApproveAssert(docId);
61 return docId;
62 }
63
64 @Test
65 public void testBlanketAppBookmark() throws Exception {
66 testBlanketApprove();
67 passed();
68 }
69
70 @Test
71 public void testBlanketAppNav() throws Exception {
72 testBlanketApprove();
73 passed();
74 }
75 }