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