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 edu.samplu.common.KradMenuLegacyITBase;
19  import org.junit.Test;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class MaintenanceDisclosuresLegacyIT extends KradMenuLegacyITBase{
25     
26      @Override
27      protected String getLinkLocator() {
28          return "Travel Account Maintenance (New)";
29      }
30  
31      @Test
32      /**
33       * Verify disclosures are present and functional
34       */
35      public void testVerifyDisclosures() throws Exception {
36          gotoMenuLinkLocator();
37          assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
38          assertElementPresentByXpath("//span[contains(text(),'Document Overview')]");
39          assertElementPresentByXpath("//span[contains(text(),'Account Information')]");
40          assertElementPresentByXpath("//span[contains(text(),'Fiscal Officer Accounts')]");
41          assertElementPresentByXpath("//span[contains(text(),'Notes and Attachments')]");
42          assertElementPresentByXpath("//span[contains(text(),'Ad Hoc Recipients')]");
43          assertElementPresentByXpath("//span[contains(text(),'Route Log')]");
44  
45          colapseExpandByXpath("//span[contains(text(),'Document Overview')]//img",
46                  "//label[contains(text(),'Organization Document Number')]");
47          colapseExpandByXpath("//span[contains(text(),'Account Information')]//img",
48                  "//label[contains(text(),'Travel Account Type Code')]");
49          colapseExpandByXpath("//span[contains(text(),'Fiscal Officer Accounts')]//img",
50                  "//a[contains(text(),'Lookup/Add Multiple Lines')]");
51  
52          expandColapseByXpath("//span[contains(text(),'Notes and Attachments')]//img", "//label[contains(text(),'Note Text')]");
53          expandColapseByXpath("//span[contains(text(),'Ad Hoc Recipients')]", "//span[contains(text(),'Ad Hoc Group Requests')]");
54  
55          // Handle frames
56          waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
57          selectFrame("routeLogIFrame");
58  
59          waitIsVisibleByXpath("//img[@alt='refresh']");
60  
61          // relative=top iframeportlet might look weird but either alone results in something not found.
62          selectTopFrame();
63          selectFrame("iframeportlet");
64          waitAndClickByXpath("//span[contains(text(),'Route Log')]//img");
65          selectFrame("routeLogIFrame");
66  
67          waitNotVisibleByXpath("//img[@alt='refresh']");
68          passed();
69      }
70  }