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.util.List;
28
29
30
31
32 public class DemoLibraryWidgetsHelpSmokeTest extends DemoLibraryBase {
33
34
35
36
37 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-Help-View&methodToCall=start";
38
39 @Override
40 protected String getBookmarkUrl() {
41 return BOOKMARK_URL;
42 }
43
44 @Override
45 protected void navigate() throws Exception {
46 waitAndClickById("Demo-LibraryLink", "");
47 waitAndClickByLinkText("Widgets");
48 waitAndClickByLinkText("Help");
49 }
50
51 protected void testWidgetsTooltipHelp() throws Exception {
52
53 fireMouseOverEvent(By.id("Demo-Help-Field1_label"));
54 WebElement helpExample1 = driver.findElement(By.xpath("//div[@data-for=\"Demo-Help-Field1_label\"]"))
55 .findElement(By.className("jquerybubblepopup-innerHtml"));
56 if (!helpExample1.isDisplayed()) {
57 fail("Example 1 help not displayed.");
58 }
59 if (!helpExample1.getText().equals("Sample text for field help - label left")) {
60 fail("Incorrect inner html text.");
61 }
62 }
63
64 @Test
65 public void testWidgetsHelpBookmark() throws Exception {
66 testWidgetsTooltipHelp();
67
68 driver.close();
69 passed();
70 }
71
72 @Test
73 public void testWidgetsHelpNav() throws Exception {
74 testWidgetsTooltipHelp();
75
76 driver.close();
77 passed();
78 }
79 }