1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.krad.screenelement;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21 import org.kuali.rice.testtools.selenium.WebDriverUtils;
22 import org.openqa.selenium.By;
23
24
25
26
27 public class ClientSideDisableAft extends WebDriverLegacyITBase {
28
29
30
31
32 public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=ClientDisableView&methodToCall=start";
33
34 @Override
35 protected String getBookmarkUrl() {
36 return BOOKMARK_URL;
37 }
38
39 @Override
40 protected void navigate() throws InterruptedException {
41 waitAndClickKRAD();
42 waitAndClickByLinkText("Client-side disable");
43 switchToWindow("Kuali :: Client-side Disable");
44 }
45
46 private void testClientSideDisable() throws Exception{
47 waitAndClickByXpath("//input[@name='field118' and @value='disable']");
48 waitForElementPresentByXpath("//input[@name='field2' and @disabled]");
49 waitForElementPresentByXpath("//textarea[@name='field3' and @disabled]");
50 waitForElementPresentByXpath("//select[@name='field3' and @disabled]");
51 waitForElementPresentByXpath("//select[@name='field114' and @disabled]");
52 waitForElementPresentByXpath("//input[@name='field117' and @type='radio' and @disabled]");
53 waitForElementPresentByXpath("//input[@name='bField1' and @type='checkbox' and @disabled]");
54 waitForElementPresentByXpath("//input[@name='field115' and @type='checkbox' and @disabled]");
55 waitForElementPresentByXpath("//button[contains(text(),'Action Button') and @disabled]");
56 waitAndClickByXpath("//input[@name='field118' and @value='enable']");
57 waitForElementNotPresent(By.xpath("//input[@name='field2' and @disabled]"));
58 waitForElementNotPresent(By.xpath("//textarea[@name='field3' and @disabled]"));
59 waitForElementNotPresent(By.xpath("//select[@name='field3' and @disabled]"));
60 waitForElementNotPresent(By.xpath("//select[@name='field114' and @disabled]"));
61 waitForElementNotPresent(By.xpath("//input[@name='field117' and @type='radio' and @disabled]"));
62 waitForElementNotPresent(By.xpath("//input[@name='bField1' and @type='checkbox' and @disabled]"));
63 waitForElementNotPresent(By.xpath("//input[@name='field115' and @type='checkbox' and @disabled]"));
64 waitAndTypeByName("field50","hi");
65 waitAndTypeByName("field51","hello");
66 waitForElementPresentByXpath("//input[@name='field54' and @disabled]");
67 waitAndTypeByName("field52","hello");
68 waitForElementPresentByXpath("//input[@name='field54']");
69 waitAndTypeByName("field53","disable");
70 waitForElementPresentByXpath("//button[contains(text(),'Action Button (change)') and @disabled]");
71 waitAndTypeByName("field52","");
72 waitForElementPresentByXpath("//button[contains(text(),'Action Button (keyUp)') and @disabled]");
73 waitForElementPresentByXpath("//button[@id='Demo-DisableSection4_add' and @disabled]");
74 waitForElementPresentByXpath("//input[@name='field12' and @disabled]");
75 waitForElementNotPresent(By.xpath("//input[@name='field10' and @disabled]"));
76 waitAndClickByXpath("//input[@name='stringList2' and @value='1']");
77 waitForElementPresentByXpath("//input[@name='field10' and @disabled]");
78 waitForElementNotPresent(By.xpath("//input[@name='field12' and @disabled]"));
79 waitAndClickByXpath("//input[@name='stringList2' and @value='2']");
80 waitAndClickByXpath("//input[@name='stringList2' and @value='3']");
81 waitForElementPresentByXpath("//input[@name='field11' and @disabled]");
82 }
83
84 @Test
85 public void testClientSideDisableBookmark() throws Exception {
86 testClientSideDisable();
87 passed();
88 }
89
90 @Test
91 public void testClientSideDisableNav() throws Exception {
92 testClientSideDisable();
93 passed();
94 }
95
96 }