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.openqa.selenium.By;
20
21
22
23
24 public class LabsLookUpConditionalCriteriaAft extends LabsLookupBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LabsLookup-ConditionalCriteriaView&hideReturnLink=true";
30
31
32
33
34 private static final String LOOKUP_CRITERIA_DATE_NAME="lookupCriteria[rangeLowerBoundKeyPrefix_createDate]";
35
36
37
38
39 private static final String FAILURE_MESSAGE="Not read only. Date input field present.";
40
41 @Override
42 protected String getBookmarkUrl() {
43 return BOOKMARK_URL;
44 }
45
46 @Override
47 protected void navigate() throws Exception {
48 navigateToLookup("Lookup Conditional Criteria");
49 }
50
51
52 protected void testLookUpConditionalCriteria() throws InterruptedException {
53
54
55 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME, "a1");
56 waitAndClickByName("lookupCriteria[name]");
57 waitForElementPresent(By.className("uif-requiredMessage"));
58 checkForIncidentReport();
59
60
61 clearTextByName(LOOKUP_CRITERIA_NUMBER_NAME);
62 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME, "a2");
63 waitAndClickByName("lookupCriteria[name]");
64 Thread.sleep(3000);
65 checkForIncidentReport();
66 if(isElementPresentByName(LOOKUP_CRITERIA_DATE_NAME)) {
67 fail(FAILURE_MESSAGE);
68 }
69
70
71 clearTextByName(LOOKUP_CRITERIA_NUMBER_NAME);
72 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME, "a3");
73 waitAndClickByName("lookupCriteria[name]");
74 Thread.sleep(3000);
75 checkForIncidentReport();
76 assertTrue(isNotVisible(By.name(LOOKUP_CRITERIA_DATE_NAME)));
77 assertTrue(isNotVisible(By.name("lookupCriteria[createDate]")));
78 }
79
80
81 @Test
82 public void testLookUpConditionalCriteriaBookmark() throws Exception {
83 testLookUpConditionalCriteria();
84 passed();
85 }
86
87 @Test
88 public void testLookUpConditionalCriteriaNav() throws Exception {
89 testLookUpConditionalCriteria();
90 passed();
91 }
92 }