1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.demo.uif.library.containers;
17
18 import org.junit.Test;
19 import org.kuali.rice.testtools.common.JiraAwareFailureUtils;
20
21 import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
22
23
24
25
26 public class LibraryContainerCollectionGroupAft extends WebDriverLegacyITBase {
27
28
29
30
31 public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CollectionGroupView&methodToCall=start";
32
33 @Override
34 protected String getBookmarkUrl() {
35 return BOOKMARK_URL;
36 }
37
38 @Override
39 protected void navigate() throws Exception {
40 waitAndClickLibraryLink();
41 waitAndClickByLinkText("Containers");
42 waitAndClickByLinkText("Collection Group");
43 }
44
45 protected void testLibraryContainerCollectionGroupTableLayout() throws Exception {
46 waitForElementPresentByXpath("//div[@id='Demo-CollectionGroup-Example1']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-disclosureContent']/div[2]/table");
47 }
48
49 protected void testLibraryContainerCollectionGroupStackedLayout() throws Exception {
50 selectByName("exampleShown","Stacked Layout");
51 waitForElementPresentByXpath("//div[@id='Demo-CollectionGroup-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-disclosureContent']/div[2]/div/table");
52 waitForElementPresentByXpath("//div[@id='Demo-CollectionGroup-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-disclosureContent']/div[2]/div[2]/table");
53 waitForElementPresentByXpath("//div[@id='Demo-CollectionGroup-Example2']/div[@class='uif-verticalBoxLayout clearfix']/div/div[@class='uif-disclosureContent']/div[2]/div[3]/table");
54 }
55
56 protected void testLibraryContainerCollectionGroupTableLayoutReadOnly() throws Exception {
57 selectByName("exampleShown","Table Layout Readonly");
58 if(isElementPresentByXpath("//button[contains(text(),'Add Line')]")){
59 JiraAwareFailureUtils.fail("Add Line present in readonly", this);
60 }
61 }
62
63 protected void testLibraryContainerCollectionGroupDictionaryAttributeSpecified() throws Exception {
64 selectByName("exampleShown","Table Layout with specified dictionaryAttributeName");
65 waitForTextPresent("Subsidized Percent");
66 waitForTextPresent("##.##");
67
68 waitForTextPresent("Travel Account Number *");
69 waitForTextPresent("Must not be more than 10 characters");
70 }
71
72 @Test
73 public void testContainerCollectionGroupBookmark() throws Exception {
74 testLibraryContainerCollectionGroupTableLayout();
75 testLibraryContainerCollectionGroupStackedLayout();
76 testLibraryContainerCollectionGroupTableLayoutReadOnly();
77 testLibraryContainerCollectionGroupDictionaryAttributeSpecified();
78 passed();
79 }
80
81 @Test
82 public void testContainerCollectionGroupNav() throws Exception {
83 testLibraryContainerCollectionGroupTableLayout();
84 testLibraryContainerCollectionGroupStackedLayout();
85 testLibraryContainerCollectionGroupTableLayoutReadOnly();
86 testLibraryContainerCollectionGroupDictionaryAttributeSpecified();
87 passed();
88 }
89 }