1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.clientresponsiveness;
17
18 import org.junit.Test;
19
20 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21
22
23
24
25 public class DemoClientResponsivenessEventsAft extends WebDriverLegacyITBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-EventsView";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 waitAndClickById("Demo-LibraryLink", "");
40 waitAndClickByLinkText("Client Responsiveness");
41 waitAndClickByLinkText("Events");
42 }
43
44 protected void testClientResponsivenessEventsClick() throws Exception {
45 waitAndClickByName("inputField1");
46 acceptAlertIfPresent();
47 waitAndClickByName("inputField2");
48 acceptAlertIfPresent();
49 waitAndClickByXpath("//input[@name='inputField3' and @value='blue']");
50 waitForElementPresentByXpath("//div[@style='border: 1px solid rgb(153, 153, 153); width: auto; background-color: rgb(0, 0, 255);']");
51 waitAndClickByName("inputField4");
52 acceptAlertIfPresent();
53 waitAndClickByXpath("//input[@name='inputField5' and @value='1']");
54 acceptAlertIfPresent();
55 }
56
57 protected void testClientResponsivenessEventsChangeFocusBlur() throws Exception {
58 waitAndClickByLinkText("OnChange, OnFocus, OnBlur Examples");
59 selectByName("inputField6","Navy");
60 waitForElementPresentByXpath("//div[@id='Demo-Events-Example2A' and @style='background-color: rgb(0, 0, 128);']");
61 fireEvent("inputField7", "focus");
62 }
63
64 protected void testClientResponsivenessEventsMouseEvent() throws Exception {
65 waitAndClickByLinkText("Mouse Events");
66 fireMouseOverEventByXpath("//div[@data-label='Checkbox' and @data-parent='Demo-Events-Example3']");
67 waitAndClickByXpath("//input[@name='inputField8' and @value='red']");
68 fireMouseOverEventByName("inputField8");
69 }
70
71 protected void testClientResponsivenessEventsMouseEventOnButtons() throws Exception {
72 waitAndClickByLinkText("Mouse Events on Buttons");
73 waitForElementPresentByXpath("//button[@style='margin-top:10px;']");
74 }
75
76 protected void testClientResponsivenessEventsGroupAndSectionEvents() throws Exception {
77 waitAndClickByLinkText("Group and Section Events");
78 fireMouseOverEventByXpath("//div[@data-parent='Demo-Events-Example5']");
79 waitForElementPresentByXpath("//div[@data-parent='Demo-Events-Example5' and @style='background-color: rgb(255, 255, 255); height: 200px; width: 300px;']");
80 }
81
82 protected void testClientResponsivenessEventsOnKeyPressUpDown() throws Exception {
83 waitAndClickByLinkText("OnKeyPress, OnKeyUp, OnKeyDown Examples");
84 waitAndTypeByName("inputField13","a");
85 acceptAlertIfPresent();
86 }
87
88
89 @Test
90 public void testClientResponsivenessEventsBookmark() throws Exception {
91 testClientResponsivenessEventsAll();
92 }
93
94 @Test
95 public void testClientResponsivenessEventsNav() throws Exception {
96 testClientResponsivenessEventsAll();
97 }
98
99 private void testClientResponsivenessEventsAll() throws Exception {
100 testClientResponsivenessEventsClick();
101 testClientResponsivenessEventsChangeFocusBlur();
102 testClientResponsivenessEventsMouseEvent();
103 testClientResponsivenessEventsMouseEventOnButtons();
104 testClientResponsivenessEventsGroupAndSectionEvents();
105 testClientResponsivenessEventsOnKeyPressUpDown();
106 passed();
107 }
108 }