001/** 002 * Copyright 2005-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package edu.sampleu.krad.screenelement; 017 018import org.junit.Test; 019import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase; 020 021/** 022 * @author Kuali Rice Team (rice.collab@kuali.org) 023 */ 024public class StandardLayoutDemoAft extends WebDriverLegacyITBase { 025 026 /** 027 * /kr-krad/uicomponents?viewId=Demo-StandardLayout&methodToCall=start 028 */ 029 public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=Demo-StandardLayout&methodToCall=start"; 030 031 @Override 032 protected String getBookmarkUrl() { 033 return BOOKMARK_URL; 034 } 035 036 @Override 037 protected void navigate() throws InterruptedException { 038 waitAndClickKRAD(); 039 waitAndClickByLinkText("Standard Layout Demo"); 040 switchToWindow("Kuali :: View Title"); 041 } 042 043 private void testStandardLayoutDemo() throws Exception{ 044 //Standard Sections 045 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section1']/input[@name='field1']"); 046 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section1']/input[@name='field2']"); 047 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section2-SubSection1' and @data-parent='Demo-StandardLayout-Section2']"); 048 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section2-SubSection2' and @data-parent='Demo-StandardLayout-Section2']"); 049 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/input[@name='field8']"); 050 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/input[@name='field9']"); 051 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/div/input[@name='field10']"); 052 waitForElementPresentByXpath("//div[@data-parent='Demo-StandardLayout-Section3']/div/input[@name='field11']"); 053 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-Section3-SubSection1' and @data-parent='Demo-StandardLayout-Section3']"); 054 055 //Collection Sections 056 waitAndClickByName("Demo-StandardLayout-CollectionSectionsPage"); 057 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section[@class='uif-collectionItem uif-boxCollectionItem uif-collectionAddItem clearfix']"); 058 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section[@class='uif-collectionItem uif-boxCollectionItem clearfix']"); 059 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSection1']/section/table[@class='table table-condensed table-bordered uif-gridLayout uif-table-fixed']"); 060 waitForElementPresentByXpath("//div[@data-group='Demo-StandardLayout-CollectionSection2-SubCollection_line0']"); 061 waitForElementPresentByXpath("//div[@id='Demo-StandardLayout-Section4']/input[@name='field15']"); 062 waitForElementPresentByXpath("//div[@id='Demo-StandardLayout-Section4']/input[@name='field16']"); 063 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CollectionSubSection' and @data-parent='Demo-StandardLayout-Section4']/section"); 064 065 //CSS Grid 066 waitAndClickByName("Demo-StandardLayout-CssGridPage"); 067 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection1' and @data-parent='Demo-StandardLayout-CssGridPage']"); 068 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection2' and @data-parent='Demo-StandardLayout-CssGridPage']"); 069 waitForElementPresentByXpath("//section[@id='Demo-StandardLayout-CssGridSection3' and @data-parent='Demo-StandardLayout-CssGridPage']"); 070 } 071 072 @Test 073 public void testStandardLayoutDemoBookmark() throws Exception { 074 testStandardLayoutDemo(); 075 passed(); 076 } 077 078 @Test 079 public void testStandardLayoutDemoNav() throws Exception { 080 testStandardLayoutDemo(); 081 passed(); 082 } 083}