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.common.Failable;
20 import org.junit.Test;
21 import org.kuali.rice.krad.uif.UifConstants;
22 import org.openqa.selenium.By;
23 import org.openqa.selenium.WebElement;
24
25 import java.util.List;
26
27
28
29
30 public class DemoLibraryGroupSmokeTest extends DemoLibraryBase {
31
32 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=ComponentLibraryHome";
33
34 @Override
35 public String getBookmarkUrl() {
36 return BOOKMARK_URL;
37 }
38
39 @Override
40 protected void navigate() throws Exception {
41 waitAndClickById("Demo-LibraryLink", "");
42 }
43
44 protected void navigationMenu() throws Exception {
45 waitAndClickByLinkText("Containers");
46 waitAndClickByLinkText("Group");
47 }
48
49 public void testBasicGroupNav(Failable failable) throws Exception {
50 testBasicGroupBookmark(this);
51 }
52
53
54
55
56
57
58
59
60 public void testBasicGroupBookmark(Failable failable) throws Exception {
61 navigationMenu();
62
63 WebElement element = driver.findElement(By.id("Demo-Group-Example1"));
64 element.findElement(By.tagName("h3"));
65
66 getElementByDataAttributeValue(UifConstants.DataAttributes.MESSAGES_FOR, "Demo-Group-Example1");
67
68 element.findElement(By.className("uif-instructionalMessage"));
69
70 List<WebElement> inputFields = element.findElements(By.className("uif-inputField"));
71 SeleneseTestBase.assertTrue("group does not contain correct number of items", inputFields.size() == 4);
72 passed();
73 }
74
75 @Test
76 public void testBasicGroupBookmark() throws Exception {
77 testBasicGroupBookmark(this);
78 }
79
80 @Test
81 public void testBasicGroupNav() throws Exception {
82 testBasicGroupNav(this);
83 }
84 }