View Javadoc

1   /*
2    * Copyright 2006-2011 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.travel;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverITBase;
21  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
22  
23  import static junit.framework.Assert.assertEquals;
24  
25  /**
26   * tests whether the watermarks is work as expected even when they contain an
27   * apostrophe
28   * 
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  public class WatermarkValidationAft extends WebDriverITBase {
32  	@Override
33  	public String getTestUrl() {
34  		return AutomatedFunctionalTestUtils.PORTAL;
35  	}
36  
37  	@Test
38  	/**
39  	 * if watermarking is ok, the cancel link will bring up a confirmation if something was typed into a textbox i.e
40  	 * the scripts will be working ok
41  	 */
42  	public void testWatermarking() throws Exception {
43  		waitAndClickByLinkText("KRAD");
44  		waitAndClickByLinkText(WebDriverLegacyITBase.UIF_COMPONENTS_KITCHEN_SINK_LINK_TEXT);
45  		Thread.sleep(5000);
46  		//Switch to new window.
47  		switchWindow();
48          waitAndClickByLinkText("Text Controls");
49          assertEquals("It's watermarked ",getAttributeByName("field106", "placeholder"));
50  		assertEquals("Watermark... ",getAttributeByName("field110", "placeholder"));
51  	}
52  }