1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.lookups;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20 import org.openqa.selenium.By;
21 import org.openqa.selenium.WebElement;
22
23 import java.util.List;
24
25
26
27
28 public class LabsLookupDefaultCreateNewBlanketApproveAft extends LabsLookupBase {
29
30
31
32
33 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LabsLookup-DefaultView&hideReturnLink=true";
34
35 @Override
36 protected String getBookmarkUrl() {
37 return BOOKMARK_URL;
38 }
39
40 @Override
41 public String getUserName() {
42 return "admin";
43 }
44
45 @Override
46 protected void navigate() throws Exception {
47 navigateToLookup("Lookup Default");
48 }
49
50 @Test
51 public void testLabsLookupDefaultCreateNewBlanketApproveBookmark() throws Exception {
52 String account = uniqueAccount();
53 testLabsLookupDefaultCreateNewBlanketApprove(account);
54 passed();
55 }
56
57 private String uniqueAccount() {
58 return "z" + AutomatedFunctionalTestUtils.createUniqueDtsPlusTwoRandomCharsNot9Digits();
59 }
60
61 @Test
62 public void testLabsLookupDefaultCreateNewBlanketApproveWithSubAccountBookmark() throws Exception {
63 testLabsLookupDefaultCreateNewBlanketApproveWithSubAccount(uniqueAccount());
64 passed();
65 }
66
67 @Test
68 public void testLabsLookupDefaultCreateNewBlanketApproveNav() throws Exception {
69 testLabsLookupDefaultCreateNewBlanketApprove(uniqueAccount());
70 passed();
71 }
72
73 @Test
74 public void testLabsLookupDefaultCreateNewBlanketApproveWithSubAccountNav() throws Exception {
75 testLabsLookupDefaultCreateNewBlanketApproveWithSubAccount(uniqueAccount());
76 passed();
77 }
78
79 protected void testLabsLookupDefaultCreateNewBlanketApprove(String account)throws Exception {
80 navigateToCreateNew();
81 waitAndTypeByName("document.documentHeader.documentDescription","Labs Default LookUp Created " + account);
82 waitAndTypeByName("document.newMaintainableObject.dataObject.number", account);
83 waitAndTypeByName("document.newMaintainableObject.dataObject.name",account);
84 waitAndTypeByName("document.newMaintainableObject.dataObject.foId","fran");
85
86 waitAndClickByXpath("//input[@value='CAT']");
87
88 waitAndClickByLinkText("Notes and Attachments (0)");
89 waitAndTypeByXpath("//textarea[@maxlength='800']","My Note " + account);
90 waitAndClickByXpath("//button[@title='Add a Note']");
91 waitAndClickByLinkText("Ad Hoc Recipients");
92 waitAndTypeByXpath("//div[@data-parent='Uif-AdHocPersonCollection']/div/input","admin");
93 waitAndClickAdHocPersonAdd();
94 waitForTextPresent("admin, admin");
95 waitAndClickByXpath("//button[@id='Uif-AdHocPersonCollection_add']");
96 waitAndClickBlanketApprove();
97
98
99
100
101
102
103
104
105 }
106
107 protected void testLabsLookupDefaultCreateNewBlanketApproveWithSubAccount(String account)throws Exception {
108 navigateToCreateNew();
109 waitAndTypeByName("document.documentHeader.documentDescription","Labs Default LookUp Created " + account);
110 waitAndTypeByName("document.newMaintainableObject.dataObject.number", account);
111 waitAndTypeByName("document.newMaintainableObject.dataObject.name", account);
112 waitAndTypeByName("document.newMaintainableObject.dataObject.foId","fran");
113
114 waitAndClickByXpath("//input[@value='CAT']");
115
116 waitAndTypeByXpath("//div[@data-label='Travel Sub Account Number']/input","1");
117 waitAndTypeByXpath("//div[@data-label='Sub Account Name']/input","Sub Account");
118 waitAndClickButtonByText("Add");
119
120 waitAndClickByLinkText("Notes and Attachments (0)");
121 waitAndTypeByXpath("//textarea[@maxlength='800']","My Note " + account);
122 waitAndClickByXpath("//button[@title='Add a Note']");
123 waitAndClickByLinkText("Ad Hoc Recipients");
124 waitAndTypeByXpath("//div[@data-parent='Uif-AdHocPersonCollection']/div/input","admin");
125 waitAndClickAdHocPersonAdd();
126 waitForTextPresent("admin, admin");
127 waitAndClickByXpath("//button[@id='Uif-AdHocPersonCollection_add']");
128 waitAndClickBlanketApprove();
129
130
131
132
133
134
135
136 }
137 }