1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.admin.test;
17
18 import edu.samplu.common.Failable;
19 import edu.samplu.common.ITUtil;
20 import org.apache.commons.lang.RandomStringUtils;
21
22
23
24
25 public abstract class IdentityPersonCreateNewAbstractSmokeTestBase extends AdminTmplMthdSTNavBase{
26
27
28
29
30
31
32
33 public static final String BOOKMARK_URL = ITUtil.PORTAL + "?channelTitle=Person&channelUrl="
34 + ITUtil.getBaseUrlString() + "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.kim.api.identity.Person&docFormKey=88888888&returnLocation="+
35 ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK ;
36
37
38
39
40
41
42 @Override
43 protected String getLinkLocator() {
44 return "Person";
45 }
46
47 public void testIdentityPersonCreateNewBookmark(Failable failable) throws Exception {
48 testIdentityPersonCreateNew();
49 passed();
50 }
51
52 public void testIdentityPersonCreateNewNav(Failable failable) throws Exception {
53 testIdentityPersonCreateNew();
54 passed();
55 }
56
57 public void testIdentityPersonCreateNew() throws Exception {
58 selectFrameIframePortlet();
59 waitAndClickByXpath(CREATE_NEW_XPATH);
60 waitAndTypeByName("document.documentHeader.documentDescription", "Test description of person");
61 selectByName("newAffln.affiliationTypeCode", "Staff");
62 selectByName("newAffln.campusCode","BL - BLOOMINGTON");
63 waitAndClickByName("newAffln.dflt");
64 waitAndClickByName("methodToCall.addAffln.anchor");
65 waitAndTypeByName("document.affiliations[0].newEmpInfo.employeeId","9999999999");
66 waitAndClickByName("document.affiliations[0].newEmpInfo.primary");
67 selectByName("document.affiliations[0].newEmpInfo.employmentStatusCode","Active");
68 selectByName("document.affiliations[0].newEmpInfo.employmentTypeCode","Professional");
69 waitAndTypeByName("document.affiliations[0].newEmpInfo.baseSalaryAmount","99999");
70 waitAndTypeByXpath("//*[@id='document.affiliations[0].newEmpInfo.primaryDepartmentCode']", "BL-BUS");
71 waitAndClickByName("methodToCall.addEmpInfo.line0.anchor");
72 waitAndClickByName("methodToCall.showAllTabs");
73 selectByName("newName.nameCode", "Primary");
74 waitAndTypeByName("newName.firstName","Marco");
75 waitAndTypeByName("newName.lastName","Simoncelli");
76 waitAndClickByName("newName.dflt");
77 waitAndClickByName("methodToCall.addName.anchor");
78 selectByName("newAddress.addressTypeCode", "Work");
79 waitAndTypeByName("newAddress.line1","123 Address Ln");
80 waitAndTypeByName("newAddress.city","Bloomington");
81 selectByName("newAddress.stateProvinceCode", "INDIANA");
82 waitAndTypeByName("newAddress.postalCode","47408");
83 selectByName("newAddress.countryCode","United States");
84 waitAndClickByName("newAddress.dflt");
85 waitAndClickByName("methodToCall.addAddress.anchor");
86 selectByName("newPhone.phoneTypeCode","Work");
87 waitAndTypeByName("newPhone.phoneNumber", "855-555-5555");
88 selectByName("newPhone.countryCode","United States");
89 waitAndClickByName("newPhone.dflt");
90 waitAndClickByName("methodToCall.addPhone.anchor");
91 waitAndTypeByName("newEmail.emailAddress","email@provider.net");
92 selectByName("newEmail.emailTypeCode","Work");
93 waitAndClickByName("newEmail.dflt");
94 waitAndClickByName("methodToCall.addEmail.anchor");
95 waitAndTypeByName("document.principalName", RandomStringUtils.randomAlphabetic(12).toLowerCase());
96
97
98 waitAndClickByName("methodToCall.route");
99 checkForDocError();
100
101 waitAndClickByName("methodToCall.close");
102 waitAndClickByName("methodToCall.processAnswer.button1");
103 }
104 }