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 edu.sampleu.krad.screenelement;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class StandardLayoutDemoAft extends WebDriverLegacyITBase {
25  
26      /**
27       * /kr-krad/uicomponents?viewId=Demo-StandardLayout&methodToCall=start
28       */
29      public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=Demo-StandardLayout&methodToCall=start";
30    
31      @Override
32      protected String getBookmarkUrl() {
33          return BOOKMARK_URL;
34      }
35  
36      @Override
37      protected void navigate() throws InterruptedException {
38          waitAndClickKRAD();
39          waitAndClickByLinkText("Standard Layout Demo");
40          switchToWindow("Kuali :: View Title");
41      }
42      
43      private void testStandardLayoutDemo() throws Exception{
44          //Standard Sections
45          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section1']/input[@name='field1']");
46          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section1']/input[@name='field2']");
47          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section2-SubSection1' and @data-parent='Demo-StandardLayout-Section2']");
48          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section2-SubSection2' and @data-parent='Demo-StandardLayout-Section2']");
49          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/input[@name='field8']");
50          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/input[@name='field9']");
51          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/div/input[@name='field10']");
52          waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/div/input[@name='field11']");
53          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section3-SubSection1' and @data-parent='Demo-StandardLayout-Section3']");
54          
55          //Collection Sections
56          waitAndClickByName("Demo-StandardLayout-CollectionSectionsPage");
57          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section[@class='uif-collectionItem uif-boxCollectionItem uif-collectionAddItem clearfix']");
58          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section[@class='uif-collectionItem uif-boxCollectionItem clearfix']");
59          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section/table[@class='table table-condensed table-bordered uif-gridLayout uif-table-fixed']");
60          waitForElementPresentByXpath("//div[@data-group='Demo-StandardLayout-CollectionSection2-SubCollection_line0']");
61          waitForElementPresentByXpath("//div[@id='Demo-StandardLayout-Section4']/input[@name='field15']");
62          waitForElementPresentByXpath("//div[@id='Demo-StandardLayout-Section4']/input[@name='field16']");
63          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSubSection' and @data-parent='Demo-StandardLayout-Section4']/section");
64          
65          //CSS Grid
66          waitAndClickByName("Demo-StandardLayout-CssGridPage");
67          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection1' and @data-parent='Demo-StandardLayout-CssGridPage']");
68          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection2' and @data-parent='Demo-StandardLayout-CssGridPage']");
69          waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection3' and @data-parent='Demo-StandardLayout-CssGridPage']");
70      }
71      
72      @Test
73      public void testStandardLayoutDemoBookmark() throws Exception {
74          testStandardLayoutDemo();
75          passed();
76      }
77  
78      @Test
79      public void testStandardLayoutDemoNav() throws Exception {
80          testStandardLayoutDemo();
81          passed();
82      }
83  }