1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.admin;
17
18 import org.apache.commons.lang.RandomStringUtils;
19
20
21
22
23 public abstract class CampusAftBase extends AdminTmplMthdAftNavCreateNewBase {
24
25 protected void createNewEnterDetails() throws InterruptedException {
26 waitAndTypeByName("document.documentHeader.documentDescription",RandomStringUtils.randomAlphabetic(30));
27 String randomAlphabetic = RandomStringUtils.randomAlphabetic(10);
28 waitAndTypeByName("document.newMaintainableObject.code",RandomStringUtils.randomAlphanumeric(2));
29 waitAndTypeByName("document.newMaintainableObject.name",randomAlphabetic);
30 waitAndTypeByName("document.newMaintainableObject.shortName",randomAlphabetic);
31 selectByName("document.newMaintainableObject.campusTypeCode","B - BOTH");
32 }
33
34
35
36
37
38
39 @Override
40 protected String getLinkLocator() {
41 return "Campus";
42 }
43
44 protected void saveAndClose() throws InterruptedException {
45 checkForDocError();
46 waitAndClickByXpath(SAVE_XPATH);
47 waitForTextPresent("Document was successfully saved");
48 waitAndClickByName("methodToCall.close");
49
50 }
51
52 protected void saveAndReload() throws InterruptedException {
53 checkForDocError();
54 waitAndClickByXpath(SAVE_XPATH);
55 waitForTextPresent("Document was successfully saved");
56 waitAndClickByName("methodToCall.reload");
57
58 }
59
60 protected void submitAndClose() throws InterruptedException {
61 checkForDocError();
62 waitAndClickByName("methodToCall.route");
63 waitForProgress("Submitting...");
64 waitForTextPresent("Document was successfully submitted");
65 waitAndClickByName("methodToCall.close");
66
67 }
68
69
70
71
72
73
74
75 protected void submit() throws InterruptedException {
76 checkForDocError();
77 waitAndClickByName("methodToCall.route");
78 waitForTextPresent("Document was successfully submitted");
79 }
80
81
82
83
84
85
86
87
88
89 protected void recall(boolean cancel) throws InterruptedException {
90 waitAndClickByName("methodToCall.recall");
91 waitForTextPresent("the reason below");
92 waitAndTypeByName("reason", "Oops!");
93 if (cancel){
94
95 waitAndClickByName("methodToCall.processAnswer.button1");
96 waitForTextPresent("RECALLED");
97 waitAndClickByName("methodToCall.close");
98 } else {
99
100 waitAndClickByName("methodToCall.processAnswer.button0");
101 waitForTextPresent("SAVED");
102 waitAndClickByName("methodToCall.close");
103 waitAndClickByName("methodToCall.processAnswer.button1");
104 }
105 }
106 }