1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.krad.demo.uif.library;
17
18 import com.thoughtworks.selenium.SeleneseTestBase;
19 import edu.samplu.krad.demo.uif.library.DemoLibraryBase;
20 import org.junit.Test;
21 import edu.samplu.common.SmokeTestBase;
22 import org.kuali.rice.krad.uif.UifConstants;
23 import org.openqa.selenium.By;
24 import org.openqa.selenium.WebElement;
25 import org.openqa.selenium.interactions.Actions;
26
27 import java.text.SimpleDateFormat;
28 import java.util.Date;
29 import java.util.List;
30
31
32
33
34 public class DemoLibraryWidgetsGrowlSmokeTest extends DemoLibraryBase {
35
36
37
38
39 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-Growls-View&methodToCall=start";
40
41 @Override
42 protected String getBookmarkUrl() {
43 return BOOKMARK_URL;
44 }
45
46 @Override
47 protected void navigate() throws Exception {
48 waitAndClickById("Demo-LibraryLink", "");
49 waitAndClickByLinkText("Widgets");
50 waitAndClickByLinkText("Growls");
51 }
52
53 protected void testWidgetsGrowlDefault() throws Exception {
54
55
56 assertTextNotPresent("Sample Message Text. Data passed: none");
57
58
59 waitAndClick(By.id("u100085"));
60
61
62 Thread.sleep(1000);
63
64
65 assertTextPresent("Sample Message Text. Data passed: none");
66 }
67
68 protected void testWidgetsDatePickerWidget() throws Exception {
69 waitAndClickByLinkText(">> Open Library Navigation");
70 waitAndClickByLinkText("Suggest");
71 waitAndClickByLinkText("Tooltip");
72 select(By.id("Demo-LargeExampleDropdown_control"), "Tooltip On Focus");
73
74
75 fireMouseOverEvent(By.id("u100101_label"));
76 Thread.sleep(1000);
77 WebElement tooltipFocusLabel = driver.findElement(By.xpath("//div[@data-for=\"u100101_label\"]")).findElement(
78 By.className("jquerybubblepopup-innerHtml"));
79 if (!tooltipFocusLabel.isDisplayed()) {
80 fail("Tooltip help for label not displayed.");
81 }
82 if (!tooltipFocusLabel.getText().equals("Click on the text box for a tool tip")) {
83 fail("Incorrect inner html text for label focus tooltip.");
84 }
85
86
87 waitAndClickById("u100101_control");
88 Thread.sleep(1000);
89 WebElement tooltipFocusControl = driver.findElement(By.xpath("//div[@data-for=\"u100101_control\"]"))
90 .findElement(By.className("jquerybubblepopup-innerHtml"));
91 if (!tooltipFocusControl.isDisplayed()) {
92 fail("Tooltip help for control not displayed.");
93 }
94 if (!tooltipFocusControl.getText().equals("This tooltip appears when the field receives focus")) {
95 fail("Incorrect inner html text for tooltip focus control.");
96 }
97 }
98
99 @Test
100 public void testWidgetsGrowlBookmark() throws Exception {
101 testWidgetsGrowlDefault();
102 driver.close();
103 passed();
104 }
105
106 @Test
107 public void testWidgetsGrowlNav() throws Exception {
108 testWidgetsGrowlDefault();
109 driver.close();
110 passed();
111 }
112 }