1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.general;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20 import org.kuali.rice.testtools.selenium.WebDriverUtils;
21 import org.openqa.selenium.By;
22
23
24
25
26 public class LibraryGeneralFeaturesReadOnlyAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-ReadOnlyView";
32
33 @Override
34 protected String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 waitAndClickLibraryLink();
41 waitAndClickByLinkText("General Features");
42 waitAndClickByLinkText("Read Only");
43 }
44
45 protected void testGeneralFeaturesReadOnly() throws Exception {
46 jGrowl("Click Read Only Example link");
47 waitAndClickByXpath("//header[@data-header_for=\"Demo-ReadOnly-Example1\"]/following-sibling::a");
48 switchToWindow("Kuali :: ReadOnly Test");
49 waitForElementPresentByXpath("//input[@name='inputField1']");
50 waitForElementPresentByXpath("//textarea[@name='inputField2']");
51 waitForElementPresentByXpath("//select[@name='inputField3']");
52 waitForElementPresentByXpath("//select[@name='inputField4']");
53 waitForElementPresentByXpath("//input[@name='inputField5']");
54 waitForElementPresentByXpath("//input[@name='booleanField1']");
55 waitForElementPresentByXpath("//input[@name='inputField6']");
56 waitForElementPresentByXpath("//input[@name='inputField7']");
57 waitForElementPresentByXpath("//select[@name='inputField8']");
58 waitForElementPresentByXpath("//input[@name='inputField9']");
59 waitForElementPresentByXpath("//input[@name='checkboxesField1']");
60 waitForElementPresentByXpath("//input[@name='checkboxesField2']");
61 waitAndClickButtonByText("Make ReadOnly");
62 waitForElementNotPresent(By.xpath("//input[@name='inputField1']"), WebDriverUtils.configuredImplicityWait() * 2);
63 waitForElementNotPresent(By.xpath("//textarea[@name='inputField2']"));
64 waitForElementNotPresent(By.xpath("//select[@name='inputField3']"));
65 waitForElementNotPresent(By.xpath("//select[@name='inputField4']"));
66 waitForElementNotPresent(By.xpath("//input[@name='inputField5']"));
67 waitForElementNotPresent(By.xpath("//input[@name='booleanField1']"));
68 waitForElementNotPresent(By.xpath("//input[@name='inputField6']"));
69 waitForElementNotPresent(By.xpath("//input[@name='inputField7']"));
70 waitForElementNotPresent(By.xpath("//select[@name='inputField8']"));
71 waitForElementNotPresent(By.xpath("//input[@name='inputField9']"));
72 waitForElementNotPresent(By.xpath("//input[@name='checkboxesField1']"));
73 waitForElementNotPresent(By.xpath("//input[@name='checkboxesField2']"));
74 waitForTextPresent("false");
75 waitForTextPresent("No Options Selected");
76 driver.close();
77 switchToWindow("Kuali");
78 }
79
80 @Test
81 public void testGeneralFeaturesReadOnlyBookmark() throws Exception {
82 testGeneralFeaturesReadOnly();
83 passed();
84 }
85
86 @Test
87 public void testGeneralFeaturesReadOnlyNav() throws Exception {
88 testGeneralFeaturesReadOnly();
89 passed();
90 }
91 }