1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.fields;
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 LibraryFieldsMessageAft extends LibraryBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-MessageFieldView&methodToCall=start";
32
33 @Override
34 public String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 navigateToLibraryDemo("Fields", "Message Field");
41 }
42
43 protected void testMessageFieldDefault() throws Exception {
44 WebElement exampleDiv = navigateToExample("Demo-MessageField-Example1");
45 WebElement field = findElement(By.cssSelector(".uif-message"), exampleDiv);
46
47 String fieldId = field.getAttribute("id");
48
49 assertTextPresent("Message Field Text", "#" + fieldId, "MessageField value not correct");
50 }
51
52 protected void testMessageFieldExpressionText() throws Exception {
53 WebElement exampleDiv = navigateToExample("Demo-MessageField-Example2");
54 WebElement field = findElement(By.cssSelector(".uif-message"), exampleDiv);
55
56 String fieldId = field.getAttribute("id");
57
58 assertTextPresent("Message Field with expression text: 'fruits'", "#" + fieldId,
59 "MessageField expression text value not correct");
60 }
61
62 protected void testMessageFieldExamples() throws Exception {
63 testMessageFieldDefault();
64 testMessageFieldExpressionText();
65 }
66
67 @Test
68 public void testMessageFieldExamplesBookmark() throws Exception {
69 testMessageFieldExamples();
70 passed();
71 }
72
73 @Test
74 public void testMessageFieldExamplesNav() throws Exception {
75 testMessageFieldExamples();
76 passed();
77 }
78
79 @Test
80 public void testMessageFieldDefaultBookmark() throws Exception {
81 testMessageFieldDefault();
82 passed();
83 }
84
85 @Test
86 public void testMessageFieldDefaultNav() throws Exception {
87 testMessageFieldDefault();
88 passed();
89 }
90
91 @Test
92 public void testMessageFieldExpressionTextBookmark() throws Exception {
93 testMessageFieldExpressionText();
94 passed();
95 }
96
97 @Test
98 public void testMessageFieldExpressionTextNav() throws Exception {
99 testMessageFieldExpressionText();
100 passed();
101 }
102 }