1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.maintenance;
17
18 import org.apache.commons.lang.RandomStringUtils;
19 import org.junit.Ignore;
20 import org.junit.Test;
21
22
23
24
25 public class LabsMaintenanceExistenceCheckAft extends LabsMaintenanceBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 navigateToMaintenance("Maintenance Sample - Existence Check");
40 }
41
42 protected void testMaintenanceExistenceCheck() throws InterruptedException {
43 waitAndClickByLinkText("Travel Account Maintenance Existence Check - The account type code and fiscal officer must exist.");
44
45 waitAndTypeByName("document.documentHeader.documentDescription", "New Travel Account");
46 String randomCode = RandomStringUtils.randomAlphabetic(9).toUpperCase();
47 waitAndTypeByName("document.newMaintainableObject.dataObject.number",randomCode);
48 waitAndTypeByName("document.newMaintainableObject.dataObject.name","Test Account Name");
49
50
51 waitAndTypeByName("document.newMaintainableObject.dataObject.accountTypeCode","xxx");
52 waitAndClickSubmitByText();
53 waitAndClickConfirmSubmitOk();
54 assertTextPresent("INITIATED");
55 waitForTextPresent("Travel Account Type Code: The specified Travel Account Type Code does not exist.");
56
57
58 Thread.sleep(1000);
59 clearTextByName("document.newMaintainableObject.dataObject.accountTypeCode");
60 waitAndTypeByName("document.newMaintainableObject.dataObject.accountTypeCode", "CAT");
61 clearTextByName("document.newMaintainableObject.dataObject.foId");
62 waitAndTypeByName("document.newMaintainableObject.dataObject.foId", "xxxx");
63 waitAndClickSubmitByText();
64 waitAndClickConfirmSubmitOk();
65 assertTextPresent("INITIATED");
66 waitForTextPresent("Fiscal Officer User ID: The specified Fiscal Officer does not exist.");
67
68
69 Thread.sleep(1000);
70 clearTextByName("document.newMaintainableObject.dataObject.foId");
71 waitAndTypeByName("document.newMaintainableObject.dataObject.foId", "fred");
72 waitAndClickSubmitByText();
73 waitAndClickConfirmSubmitOk();
74 assertTextPresent("ENROUTE");
75 }
76
77 @Test
78 @Ignore
79 public void testMaintenanceExistenceCheckBookmark() throws Exception {
80 testMaintenanceExistenceCheck();
81 passed();
82 }
83
84 @Test
85 @Ignore
86 public void testMaintenanceExistenceCheckNav() throws Exception {
87 testMaintenanceExistenceCheck();
88 passed();
89 }
90 }