View Javadoc
1   /**
2    * Copyright 2005-2015 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
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   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class LibraryContainerCollectionGroupAft extends WebDriverLegacyITBase {
27  
28      /**
29       * /kr-krad/kradsampleapp?viewId=Demo-CollectionGroupView&methodToCall=start
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  }