1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.kitchensink;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.selenium.WebDriverUtils;
20
21
22
23
24
25 public class LabsEventExampleAft extends LabsKitchenSinkBase {
26
27 public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&formKey=307ef15f-6e22-469b-bb4e-dc0d13056b5d&cacheKey=fkxfb8lxq8rozbctlgbz0k0zoa&pageId=UifCompView-Page11#UifCompView-Page11";
28 @Override
29 protected String getBookmarkUrl() {
30 return BOOKMARK_URL;
31 }
32
33 @Override
34 protected void navigate() throws Exception {
35 navigateToKitchenSink("Event Examples");
36 }
37
38 @Test
39 public void testKitchenSinkEventExamplesBookmark() throws Exception {
40 testKitchenSinkEventExamples();
41 passed();
42 }
43
44 @Test
45 public void testKitchenSinkEventExamplesNav() throws Exception {
46 testKitchenSinkEventExamples();
47 passed();
48 }
49
50 protected void testKitchenSinkEventExamples() throws InterruptedException
51 {
52
53 waitAndClickByName("field100");
54 alertAccept();
55 waitAndClickByName("field112");
56 alertAccept();
57 waitAndClickByXpath("//div[@data-parent='UifCompView-WindowEvents-Group1']/fieldset/span/input[@name='field118' and @value='blue']"); // Radio OnClick Example: blue
58 waitForElementPresentByXpath("//div[@style='border: 1px solid rgb(153, 153, 153); width: auto; background-color: rgb(0, 0, 255);']");
59 waitAndClickByXpath("//div[@data-parent='UifCompView-WindowEvents-Group1']/input[@type='checkbox' and @name='bField1']"); // Checkbox:
60 alertAccept();
61 waitAndClickByXpath("//input[@type='checkbox' and @name='field115' and @value='1']"); // Checkboxes 2: Option 1
62 alertAccept();
63
64
65 selectByXpath("//div[@data-parent='UifCompView-WindowEvents-Group2']/select","Lime");
66 waitForElementPresentByXpath("//div[@style='background-color: rgb(0, 255, 0);']");
67 fireEvent("field110", "focus");
68 waitAndClickById("Group2-principalName_control");
69 alertAccept();
70 waitAndClickByName("field131");
71 alertAccept();
72
73
74 assertElementPresentByXpath("//div[@id='Group4-Image1']");
75 waitAndClickByXpath("//div[@id='Group4-Image1']/img");
76 waitForElementPresentByXpath("//div[@style='margin-left: 80px;' and @id='Group4-Image1']");
77
78
79 fireMouseOverEventByXpath("//div[@style='border: 0px solid #999999; width:10%;']");
80
81
82 waitAndClickByXpath("//button[@style='margin-top:10px;']");
83 alertAccept();
84
85
86 fireMouseOverEventByXpath("//div[@style='background-color:red;height:200px; width:300px;']");
87 waitForElementPresentByXpath("//div[@style='background-color: rgb(255, 255, 255); height: 200px; width: 300px;']");
88
89
90 waitAndTypeByXpath("(//input[@name='field100'])[3]", "a"); // Field Label:
91 alertAccept();
92 }
93 }