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.AutomatedFunctionalTestUtils; 020import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase; 021import org.kuali.rice.testtools.selenium.WebDriverUtils; 022 023/** 024 * @author Kuali Rice Team (rice.collab@kuali.org) 025 */ 026public class ReadOnlyFieldsDemoAft extends WebDriverLegacyITBase { 027 028 /** 029 * /kr-krad/uicomponents?viewId=Demo-ReadOnlyTestView&methodToCall=start 030 */ 031 public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=Demo-ReadOnlyTestView&methodToCall=start"; 032 033 @Override 034 protected String getBookmarkUrl() { 035 return BOOKMARK_URL; 036 } 037 038 @Override 039 protected void navigate() throws InterruptedException { 040 waitAndClickKRAD(); 041 waitAndClickByLinkText("ReadOnly fields Demo"); 042 switchToWindow("Kuali :: ReadOnly Test"); 043 } 044 045 private void testReadOnlyFieldsDemo() throws Exception{ 046 waitAndTypeByName("field2","Hi"); 047 waitAndTypeByName("field3","KualiRice!"); 048 selectByName("field4","Option 1"); 049 waitAndClickByName("field117","2"); 050 waitAndClickByName("field115","3"); 051 waitAndTypeByName("date1","02/17/2014"); 052 selectByName("field116","Option 3"); 053 waitAndClickButtonByText("Make ReadOnly"); 054 String [] assertText = {"Hi","KualiRice!","Option 1","02/17/2014","Option 3"}; 055 assertTextPresent(assertText); 056 } 057 058 @Test 059 public void testReadOnlyFieldsDemoBookmark() throws Exception { 060 testReadOnlyFieldsDemo(); 061 passed(); 062 } 063 064 @Test 065 public void testReadOnlyFieldsDemoNav() throws Exception { 066 testReadOnlyFieldsDemo(); 067 passed(); 068 } 069 070}