1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.lookupviews.lookup;
17
18 import org.kuali.rice.testtools.selenium.SmokeTestBase;
19 import org.junit.Test;
20
21
22
23
24 public class DemoLookUpSmokeTest extends SmokeTestBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleView&hideReturnLink=true";
30
31
32
33
34 private static final String LOOKUP_CRITERIA_NUMBER_NAME="lookupCriteria[number]";
35
36
37
38
39 private static final String SEARCH="Search";
40
41
42
43
44 private static final String CLEAR_VALUES="Clear Values";
45
46 @Override
47 public String getBookmarkUrl() {
48 return BOOKMARK_URL;
49 }
50
51 @Override
52 protected void navigate() throws Exception {
53 waitAndClickById("Demo-DemoLink", "");
54 waitAndClickByLinkText("Lookup");
55 }
56
57 protected void testLookUp() throws InterruptedException {
58 waitAndTypeByName(LOOKUP_CRITERIA_NUMBER_NAME,"a1");
59 waitAndClickButtonByText(SEARCH);
60 Thread.sleep(3000);
61 waitForElementPresentByXpath("//a[contains(text(), 'a1')]");
62 waitAndClickButtonByText(CLEAR_VALUES);
63 waitAndClickButtonByText(SEARCH);
64 Thread.sleep(3000);
65 assertElementPresentByXpath("//a[contains(text(), 'a1')]");
66 assertElementPresentByXpath("//a[contains(text(), 'a2')]");
67 }
68
69 @Test
70 public void testLookUpBookmark() throws Exception {
71 testLookUp();
72 passed();
73 }
74
75 @Test
76 public void testLookUpNav() throws Exception {
77 testLookUp();
78 passed();
79 }
80 }