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