1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.widgets;
17
18 import org.junit.Test;
19 import org.kuali.rice.krad.demo.uif.library.LibraryBase;
20 import org.openqa.selenium.By;
21 import org.openqa.selenium.WebElement;
22
23
24
25
26 public class LibraryWidgetsLightBoxAft extends LibraryBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-LightboxView";
32
33 @Override
34 protected String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 navigateToLibraryDemo("Widgets", "Lightbox");
41 }
42
43 protected void testWidgetsLightBoxHtml() throws Exception {
44 waitAndClickButtonByExactText("Lightbox from Dynamic HTML");
45 waitForElementPresentByXpath("//div[@class='fancybox-inner']/form/b");
46 waitAndClickByXpath("//a[@class='fancybox-item fancybox-close']");
47 }
48
49 protected void testWidgetDirectLightBoxHiddenImage() throws Exception
50 { waitAndClickByLinkText("Lightbox From a Hidden Image");
51 waitAndClickButtonByExactText("Show Lightbox with Image");
52 waitForElementPresentByXpath("//div[@class='fancybox-inner']/form/img");
53 waitAndClickByXpath("//a[@class='fancybox-item fancybox-close']");
54 }
55
56 protected void testWidgetDirectLightBoxUrl() throws Exception {
57 waitAndClickByLinkText("Lightbox From a URL");
58 waitAndClickButtonByExactText("Show Lightbox with URL");
59 waitForElementPresentByXpath("//iframe[@src='http://kuali.org']");
60 waitAndClickByXpath("//a[@class='fancybox-item fancybox-close']");
61 }
62
63 private void testAllLightBox() throws Exception {
64 testWidgetsLightBoxHtml();
65 testWidgetDirectLightBoxHiddenImage();
66 testWidgetDirectLightBoxUrl();
67 passed();
68 }
69
70 @Test
71 public void testWidgetsLightBoxBookmark() throws Exception {
72 testAllLightBox();
73 }
74
75 @Test
76 public void testWidgetsLightBoxNav() throws Exception {
77 testAllLightBox();
78 }
79 }