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