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 LabsLookupMaskedFieldAft extends LabsLookupBase {
25
26
27
28
29 public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LabsLookup-MaskedFieldView&hideReturnLink=true";
30
31 @Override
32 protected String getBookmarkUrl() {
33 return BOOKMARK_URL;
34 }
35
36 @Override
37 protected void navigate() throws Exception {
38 navigateToLookup("Lookup with Masked Field");
39 }
40
41 @Test
42 public void testLabsLookupMaskedFieldBookmark() throws Exception {
43 testLabsLookupMaskedFieldNoSearchCriteria();
44 testLabsLookupMaskedField();
45 testLabsLookupMaskedFieldWildcard();
46 passed();
47 }
48
49 @Test
50 public void testLabsLookupMaskedFieldNav() throws Exception {
51 testLabsLookupMaskedFieldNoSearchCriteria();
52 testLabsLookupMaskedField();
53 testLabsLookupMaskedFieldWildcard();
54 passed();
55 }
56
57 protected void testLabsLookupMaskedField()throws Exception {
58 waitAndTypeByName("lookupCriteria[number]","a1*");
59 waitAndSelectByName("uLookupResults_layout_length", "25");
60 assertTextPresent(new String[] {"a14", "*********"});
61 waitAndClickButtonByText("Clear Values");
62 waitAndTypeByName("lookupCriteria[name]","Travel Account 1");
63 waitAndClickButtonByText("Search");
64 assertTextPresent(new String[] {"a1", "*********"});
65 }
66
67 protected void testLabsLookupMaskedFieldWildcard()throws Exception {
68 waitForElementVisibleBy(By.name("lookupCriteria[name]"));
69 clearTextByName("lookupCriteria[name]");
70 waitAndTypeByName("lookupCriteria[number]","a1*");
71 waitAndTypeByName("lookupCriteria[name]","Travel *");
72 waitAndClickButtonByText("Search");
73 waitForTextPresent("Travel Account Name is a secure field. Wildcards are not allowed on secure fields.");
74 }
75
76 protected void testLabsLookupMaskedFieldNoSearchCriteria()throws Exception {
77 waitAndClickButtonByText("Search");
78 waitForProgressLoading();
79 waitForTextPresent("Showing 1 to 10 of");
80 }
81 }