View Javadoc

1   /**
2    * Copyright 2004-2013 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.hr.time.clock.web;
17  
18  import org.junit.After;
19  import org.junit.Before;
20  import org.junit.Ignore;
21  
22  import com.thoughtworks.selenium.DefaultSelenium;
23  import com.thoughtworks.selenium.SeleneseTestCase;
24  
25  @Ignore
26  public class ClockSeleniumTest extends SeleneseTestCase {
27  	@Before
28  	public void setUp() throws Exception {
29  		selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8090/");
30  		try {
31  			selenium.start();
32  		} catch (Exception e) {
33  		}
34  	}
35  
36  	@Ignore
37  	public void testClockSelenium() throws Exception {
38  		selenium.open("/tk-dev/Clock.do");
39  		selenium.type("__login_user", "admin");
40  		selenium.click("//input[@name='login']");
41  		selenium.waitForPageToLoad("30000");
42  		
43  		//total hours exceeds the original hours
44  		selenium.click("//input[@name='distributeTime']");
45  		selenium.waitForPopUp("distributePopup", "30000");
46  		selenium.selectWindow("distributePopup");  //select the new window
47  		selenium.getBodyText();
48  		selenium.click("//input[@name='editTimeBlock']");
49  		selenium.waitForPageToLoad("30000");
50  		selenium.click("//input[@name='addTimeBlock']");  // add two time blocks
51  		selenium.click("//input[@name='addTimeBlock']");
52  		selenium.click("//input[@name='saveTimeBlock']");
53  		assertTrue(selenium.isTextPresent("Total Hours entered not equel to the hours of the original time block"));
54  		
55  		// new time blocks has overlaps with existing time blocks
56  		selenium.type("beginTimeField", "08:15 AM");
57  		selenium.close();  // close the new window
58  		selenium.selectWindow(null); // go back to the original window
59  	}
60  
61  	@After
62  	public void tearDown() throws Exception {
63  		selenium.stop();
64  	}
65  }