View Javadoc

1   /*
2    * Copyright 2006-2012 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 edu.samplu.krad.travelview;
17  
18  import com.thoughtworks.selenium.DefaultSelenium;
19  import org.junit.After;
20  import org.junit.Before;
21  import org.junit.Test;
22  
23  import static org.junit.Assert.assertTrue;
24  
25  public class MaintenanceHeaderIT {
26      private DefaultSelenium selenium;
27  
28      @Before
29      public void setUp() throws Exception {
30          selenium = new DefaultSelenium("localhost", 4444, "*chrome", System.getProperty("remote.public.url"));
31          selenium.start();
32      }
33  
34      @Test
35      /**
36       * Verify Document Number, Initiator Network Id, Document Status, and Creation Timestamp fields appear
37       */
38      public void testVerifyHeaderFields() throws Exception {
39          selenium.open("/kr-dev/portal.do");
40          selenium.type("name=__login_user", "admin");
41          selenium.click("css=input[type=\"submit\"]");
42          selenium.waitForPageToLoad("30000");
43          selenium.click("link=KRAD");
44          selenium.waitForPageToLoad("50000");
45          selenium.click("link=Travel Account Maintenance (New)");
46          selenium.waitForPageToLoad("100000");
47          selenium.selectFrame("iframeportlet");
48          assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentNumber')]"));
49          assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentInitiatorNetworkId')]"));
50          assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentStatus')]"));
51          assertTrue(selenium.isElementPresent("//div[contains(@class, 'uif-documentCreateDate')]"));
52      }
53  
54      @After
55      public void tearDown() throws Exception {
56          selenium.stop();
57      }
58  }