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.DemoLibraryBase;
20 import org.openqa.selenium.By;
21
22
23
24
25 public class DemoWidgetsGrowlAft extends DemoLibraryBase {
26
27
28
29
30 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-GrowlsView&methodToCall=start";
31
32 @Override
33 protected String getBookmarkUrl() {
34 return BOOKMARK_URL;
35 }
36
37 @Override
38 protected void navigate() throws Exception {
39 navigateToLibraryDemo("Widgets", "Growls");
40 }
41
42 protected void testWidgetsGrowlServerSide() throws Exception {
43 selectByName("exampleShown","Server-side Growls");
44
45
46 assertTextNotPresent("Sample Message Text. Data passed: none");
47
48
49 waitAndClickButtonByText("Growl");
50
51
52 Thread.sleep(1000);
53
54
55 String growlText = findElement(By.className("jGrowl-message")).getText();
56
57
58 assertTrue(growlText.equals("Sample Message Text. Data passed: none"));
59 }
60
61 protected void testWidgetsGrowlClientSide() throws Exception {
62 selectByName("exampleShown","Client-side Growls");
63
64
65 waitAndClickByXpath("//section[@id='Demo-Growls-Example2']/button");
66
67
68 Thread.sleep(500);
69
70
71 String growlText = findElement(By.className("growlUI")).getText();
72 assertTrue(growlText.equals("Growl Test\nThis is a test growl message"));
73 }
74
75 @Test
76 public void testWidgetsGrowlBookmark() throws Exception {
77 testWidgetsGrowlClientSide();
78 testWidgetsGrowlServerSide();
79 passed();
80 }
81
82 @Test
83 public void testWidgetsGrowlNav() throws Exception {
84 testWidgetsGrowlClientSide();
85 testWidgetsGrowlServerSide();
86 passed();
87 }
88 }