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.layoutmanagers;
17  
18  import org.junit.Test;
19  
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class LibraryLayoutManagersCssGridLayoutAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/kradsampleapp?viewId=Demo-CssGridLayoutManagerView&methodToCall=start
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CssGridLayoutManagerView&methodToCall=start";
31  
32      @Override
33      protected String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          waitAndClickLibraryLink();
40          waitAndClickByLinkText("Layout Managers");
41          waitAndClickByLinkText("Css Grid Layout");
42      }
43  
44      protected void testLayoutManagersCssGridLayoutDefault() throws Exception {
45          selectByName("exampleShown", "Default");
46          waitForElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example1']/div[@class='col-md-4']/div/p");
47          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example1']/div[@class='col-md-4']/div/label");
48          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example1']/div[@class='col-md-4']/div/input");
49          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example1']/div[@class='col-md-6']/div/label");
50          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example1']/div[@class='col-md-6']/div/input");
51      }
52      
53      protected void testLayoutManagersCssGridLayoutDefaultWidthBehaviour() throws Exception {
54          selectByName("exampleShown", "Default width behavior");
55          waitForElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example2']/div[@class='col-md-12']");
56          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example2']/div[@class='md-clear-left col-md-8']");
57          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example2']/div[@class='col-md-4']");
58       }
59      
60      protected void testLayoutManagersCssGridLayoutFieldLabelColumns() throws Exception {
61          selectByName("exampleShown", "Field Label Columns");
62          waitForElementPresentByXpath("//section[@data-parent='Demo-CssGridLayoutManager-Example3']/div[@class='col-md-3 uif-cssGridLabelCol']");
63          assertElementPresentByXpath("//section[@data-parent='Demo-CssGridLayoutManager-Example3']/div[@class='col-md-2 uif-cssGridLabelCol']");
64          assertElementPresentByXpath("//section[@data-parent='Demo-CssGridLayoutManager-Example3']/div[@class='col-md-4']");
65       }
66      
67      protected void testLayoutManagersCssGridLayoutDefaultColspan() throws Exception {
68          selectByName("exampleShown", "Default ColSpan");
69          waitForElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example6']/div[@class='col-md-4']");
70      }
71      
72      protected void testLayoutManagersCssGridLayoutGroupLayout() throws Exception {
73          selectByName("exampleShown", "Group Layout");
74          waitForElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example7']/div[@class='col-md-4']/section[@class='uif-boxSection' and @style='background-color: #00CC66; height: 200px;']");
75          assertElementPresentByXpath("//div[@data-parent='Demo-CssGridLayoutManager-Example7']/div[@class='col-md-8']/section[@class='uif-boxSection' and @style='background-color: #00CCFF; height: 200px;']");
76       }
77      
78      @Test
79      public void testLayoutManagersCssGridLayoutBookmark() throws Exception {
80      	testLayoutManagersCssGridLayoutAll();
81      }
82  
83      @Test
84      public void testLayoutManagersCssGridLayoutNav() throws Exception {
85      	testLayoutManagersCssGridLayoutAll();
86      }  
87      
88      private void testLayoutManagersCssGridLayoutAll() throws Exception {
89      	testLayoutManagersCssGridLayoutDefault();
90          testLayoutManagersCssGridLayoutDefaultWidthBehaviour();
91          testLayoutManagersCssGridLayoutFieldLabelColumns();
92          testLayoutManagersCssGridLayoutDefaultColspan();
93          testLayoutManagersCssGridLayoutGroupLayout();
94          passed();
95      }
96  }