001 /* 002 * Copyright 2005-2013 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 */ 016 017 package edu.samplu.krad.configview; 018 019 import edu.samplu.common.ITUtil; 020 import edu.samplu.common.WebDriverLegacyITBase; 021 022 import org.junit.Test; 023 024 /** 025 * Test the help widget 026 * 027 * @author Kuali Rice Team (rice.collab@kuali.org) 028 */ 029 public class HelpNavIT2 extends WebDriverLegacyITBase { 030 031 /** 032 * URL for the Configuration Test View - Help 033 * 034 * <p> 035 * Due to a WebDriver bug (feature?) the tooltips can not be tested with WebDriver. 036 * {@link HelpWDIT} is being used to test help tooltips. 037 * </p> 038 * 039 * @see edu.samplu.common.WebDriverITBase#getTestUrl() 040 */ 041 @Override 042 public String getTestUrl() { 043 return ITUtil.PORTAL; 044 } 045 046 /** 047 * Test the tooltip and external help on the view 048 */ 049 @Test 050 public void testViewHelp2() throws Exception { 051 navigateToHelp(); 052 super.testViewHelp2(); 053 passed(); 054 } 055 056 /** 057 * Test the external help on the section and fields 058 */ 059 @Test 060 public void testExternalHelp2() throws Exception { 061 navigateToHelp(); 062 super.testExternalHelp2(); 063 passed(); 064 } 065 066 /** 067 * Test the external help on the sub-section and display only fields 068 */ 069 @Test 070 public void testDisplayOnlyExternalHelp2() throws Exception { 071 navigateToHelp(); 072 super.testDisplayOnlyExternalHelp2(); 073 passed(); 074 } 075 076 /** 077 * Test the external help on the section and fields with missing help URL 078 */ 079 @Test 080 public void testMissingExternalHelp2() throws Exception { 081 navigateToHelp(); 082 super.testMissingExternalHelp2(); 083 passed(); 084 } 085 086 private void navigateToHelp() throws Exception 087 { 088 waitAndClickKRAD(); 089 waitAndClickByXpath(CONFIGURATION_VIEW_XPATH); 090 switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE); 091 waitAndClickByLinkText("Help"); 092 Thread.sleep(5000); 093 selectFrameIframePortlet(); 094 } 095 }