001    /*
002     * Copyright 2006-2012 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 edu.samplu.krad.travelview;
017    
018    import com.thoughtworks.selenium.DefaultSelenium;
019    import org.junit.After;
020    import org.junit.Before;
021    import org.junit.Test;
022    
023    import static org.junit.Assert.assertTrue;
024    
025    public class MaintenanceHeaderIT {
026        private DefaultSelenium selenium;
027    
028        @Before
029        public void setUp() throws Exception {
030            selenium = new DefaultSelenium("localhost", 4444, "*chrome", System.getProperty("remote.public.url"));
031            selenium.start();
032        }
033    
034        @Test
035        /**
036         * Verify Document Number, Initiator Network Id, Document Status, and Creation Timestamp fields appear
037         */
038        public void testVerifyHeaderFields() throws Exception {
039            selenium.open("/kr-dev/portal.do");
040            selenium.type("name=__login_user", "admin");
041            selenium.click("css=input[type=\"submit\"]");
042            selenium.waitForPageToLoad("30000");
043            selenium.click("link=KRAD");
044            selenium.waitForPageToLoad("50000");
045            selenium.click("link=Travel Account Maintenance (New)");
046            selenium.waitForPageToLoad("100000");
047            selenium.selectFrame("iframeportlet");
048            assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentNumber')]"));
049            assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentInitiatorNetworkId')]"));
050            assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentStatus')]"));
051            assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentCreateDate')]"));
052        }
053    
054        @After
055        public void tearDown() throws Exception {
056            selenium.stop();
057        }
058    }