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
22
23
24
25 public class LibraryWidgetsGrowlAft extends LibraryBase {
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 waitForProgressLoading();
52
53
54 String growlText = findElement(By.className("jGrowl-message")).getText();
55
56
57 assertTrue(growlText.equals("Sample Message Text. Data passed: none"));
58 }
59
60 protected void testWidgetsGrowlClientSide() throws Exception {
61 selectByName("exampleShown","Client-side Growls");
62
63
64 waitAndClickByXpath("//section[@id='Demo-Growls-Example2']/button");
65
66
67 Thread.sleep(500);
68
69
70 String growlText = findElement(By.className("growlUI")).getText();
71 assertTrue(growlText.equals("Growl Test\nThis is a test growl message"));
72 }
73
74 @Test
75 public void testWidgetsGrowlBookmark() throws Exception {
76 testWidgetsGrowlClientSide();
77 testWidgetsGrowlServerSide();
78 passed();
79 }
80
81 @Test
82 public void testWidgetsGrowlNav() throws Exception {
83 testWidgetsGrowlClientSide();
84 testWidgetsGrowlServerSide();
85 passed();
86 }
87 }