1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.controls;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21
22
23
24
25 public class LibraryControlRadioAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-RadioControlView&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickLibraryLink();
40 waitAndClickByLinkText("Controls");
41 waitAndClickByLinkText("Radio");
42 }
43
44 protected void testLibraryControlRadioOptionsFinder() throws Exception {
45 waitAndClickByLinkText("OptionsFinder");
46 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example1']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='1']");
47 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example1']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='5']");
48 }
49
50 protected void testLibraryControlRadioKeyValuePairs() throws Exception {
51 waitAndClickByLinkText("Key-value pr.");
52 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example2']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='1']");
53 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example2']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='2']");
54 }
55
56 protected void testLibraryControlRadioDisabled() throws Exception {
57 waitAndClickByLinkText("Disabled");
58 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example3']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='1']");
59 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example3']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='2']");
60 }
61
62 protected void testLibraryControlRadioDelimiter() throws Exception {
63 waitAndClickByLinkText("Delimiter");
64 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example4']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='1']");
65 assertTextPresent(";");
66 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example4']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='2']");
67 }
68
69 protected void testLibraryControlRadioEvaluateDisabledOnKeyUp() throws Exception {
70 waitAndClickByLinkText("Evaluate disabled on key up");
71 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example5']/fieldset/span/input[@type='radio' and @name='inputField2' and @disabled='disabled' and @value='1']");
72 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example5']/fieldset/span/input[@type='radio' and @name='inputField2' and @disabled='disabled' and @value='2']");
73 waitAndTypeByName("inputField1","a");
74 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example5']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='1']");
75 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example5']/fieldset/span/input[@type='radio' and @name='inputField2' and @value='2']");
76 }
77
78 protected void testLibraryControlRadioEnableWhenChanged() throws Exception {
79 waitAndClickByLinkText("Enable when changed");
80 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example6']/fieldset/span/input[@type='radio' and @name='inputField4' and @disabled='disabled' and @value='1']");
81 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example6']/fieldset/span/input[@type='radio' and @name='inputField4' and @disabled='disabled' and @value='2']");
82 waitAndTypeByName("inputField3","a");
83 typeTab();
84 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example6']/fieldset/span/input[@type='radio' and @name='inputField4' and @value='1']");
85 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example6']/fieldset/span/input[@type='radio' and @name='inputField4' and @value='2']");
86 }
87
88 protected void testLibraryControlRadioDisableWhenChanged() throws Exception {
89 waitAndClickByLinkText("Disable when changed");
90 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example7']/fieldset/span/input[@type='radio' and @name='inputField6' and @value='1']");
91 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example7']/fieldset/span/input[@type='radio' and @name='inputField6' and @value='2']");
92 waitAndTypeByName("inputField5","a");
93 typeTab();
94 waitForElementPresentByXpath("//div[@data-parent='Demo-RadioControl-Example7']/fieldset/span/input[@disabled]");
95 }
96
97 @Test
98 public void testControlRadioBookmark() throws Exception {
99 testLibraryControlRadioOptionsFinder();
100 testLibraryControlRadioKeyValuePairs();
101 testLibraryControlRadioDisabled();
102 testLibraryControlRadioDelimiter();
103 testLibraryControlRadioEvaluateDisabledOnKeyUp();
104 testLibraryControlRadioEnableWhenChanged();
105 testLibraryControlRadioDisableWhenChanged();
106 passed();
107 }
108
109 @Test
110 public void testControlRadioNav() throws Exception {
111 testLibraryControlRadioOptionsFinder();
112 testLibraryControlRadioKeyValuePairs();
113 testLibraryControlRadioDisabled();
114 testLibraryControlRadioDelimiter();
115 testLibraryControlRadioEvaluateDisabledOnKeyUp();
116 testLibraryControlRadioEnableWhenChanged();
117 testLibraryControlRadioDisableWhenChanged();
118 passed();
119 }
120 }