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