001    /**
002     * Copyright 2004-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    package org.kuali.hr.time.clock.web;
017    
018    import com.thoughtworks.selenium.*;
019    import org.junit.After;
020    import org.junit.Before;
021    import org.junit.Ignore;
022    import org.junit.Test;
023    
024    @Ignore
025    public class ClockSeleniumTest extends SeleneseTestCase {
026            @Before
027            public void setUp() throws Exception {
028                    selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:8090/");
029                    try {
030                            selenium.start();
031                    } catch (Exception e) {
032                    }
033            }
034    
035            @Ignore
036            public void testClockSelenium() throws Exception {
037                    selenium.open("/tk-dev/Clock.do");
038                    selenium.type("__login_user", "admin");
039                    selenium.click("//input[@name='login']");
040                    selenium.waitForPageToLoad("30000");
041    
042                    //total hours exceeds the original hours
043                    selenium.click("//input[@name='distributeTime']");
044                    selenium.waitForPopUp("distributePopup", "30000");
045                    selenium.selectWindow("distributePopup");  //select the new window
046                    selenium.getBodyText();
047                    selenium.click("//input[@name='editTimeBlock']");
048                    selenium.waitForPageToLoad("30000");
049                    selenium.click("//input[@name='addTimeBlock']");  // add two time blocks
050                    selenium.click("//input[@name='addTimeBlock']");
051                    selenium.click("//input[@name='saveTimeBlock']");
052                    assertTrue(selenium.isTextPresent("Total Hours entered not equel to the hours of the original time block"));
053    
054                    // new time blocks has overlaps with existing time blocks
055                    selenium.type("beginTimeField", "08:15 AM");
056                    selenium.close();  // close the new window
057                    selenium.selectWindow(null); // go back to the original window
058            }
059    
060            @After
061            public void tearDown() throws Exception {
062                    selenium.stop();
063            }
064    }