1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package edu.samplu.krad.configview;
18
19 import edu.samplu.common.WebDriverITBase;
20 import org.junit.Test;
21 import org.openqa.selenium.By;
22 import org.openqa.selenium.interactions.Actions;
23
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertFalse;
26 import static org.junit.Assert.assertTrue;
27
28
29
30
31
32
33 public class HelpIT2 extends WebDriverITBase {
34
35
36
37
38
39
40
41
42
43
44
45 @Override
46 public String getTestUrl() {
47 return "http://localhost:8080/kr-dev/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView-Help&methodToCall=start";
48 }
49
50
51
52
53 @Test
54 public void testViewHelp() throws Exception {
55
56 if (isElementPresentQuick(By.cssSelector("td.jquerybubblepopup-innerHtml"))) {
57 assertFalse(driver.findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).isDisplayed());
58 }
59 Actions action = new Actions(driver);
60 action.moveToElement(driver.findElement(By.cssSelector("h1 .uif-headerText-span"))).perform();
61 assertEquals(driver.findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).getText(), "Sample text for view help");
62 assertTrue(driver.findElement(By.cssSelector("td.jquerybubblepopup-innerHtml")).isDisplayed());
63 action.moveToElement(driver.findElement(By.id("mouse-out"))).perform();
64
65
66
67
68
69
70
71
72
73
74
75 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Configuration Test View - Help\"]"), "HelpWindow", "http://www.kuali.org/?view");
76 }
77
78
79
80
81 @Test
82 public void testExternalHelp() throws Exception {
83
84 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for External Help\"]"), "HelpWindow", "http://www.kuali.org/?section");
85
86
87 assertPopUpWindowUrl(By.cssSelector("#field-label-left-external-help .uif-helpImage"), "HelpWindow",
88 "http://www.kuali.org/?label_left");
89
90
91 assertPopUpWindowUrl(By.cssSelector("#field-label-right-external-help .uif-helpImage"), "HelpWindow",
92 "http://www.kuali.org/?label_right");
93
94
95 assertPopUpWindowUrl(By.cssSelector("#field-label-top-external-help .uif-helpImage"), "HelpWindow",
96 "http://www.kuali.org/?system_parm");
97
98
99 assertPopUpWindowUrl(By.id("standalone-external-help"), "HelpWindow", "http://www.kuali.org/?widget_only");
100 }
101
102
103
104
105 @Test
106 public void testDisplayOnlyExternalHelp() throws Exception {
107
108 assertPopUpWindowUrl(By.cssSelector("input[title=\"Help for Display only fields\"]"), "HelpWindow", "http://www.kuali.org/?sub_section");
109
110
111 assertPopUpWindowUrl(By.cssSelector("#display-field-external-help .uif-helpImage"), "HelpWindow",
112 "http://www.kuali.org/?display_field");
113 }
114
115
116
117
118 @Test
119 public void testMissingExternalHelp() throws Exception {
120
121 isElementPresent(By.cssSelector("input[title=\"Help for Missing External Help\"]"));
122
123
124 isElementPresentQuick(By.cssSelector("#external-help-externalHelpUrl-empty .uif-helpImage"));
125
126
127 isElementPresentQuick(By.cssSelector("#external-help-helpdefinition-empty .uif-helpImage"));
128
129
130 isElementPresentQuick(By.cssSelector("#external-help-system-parm-missing .uif-helpImage"));
131
132
133 isElementPresentQuick(By.id("standalone-external-help-missing"));
134 }
135 }