View Javadoc

1   /**
2    * Copyright 2005-2013 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.demo.travel.account.inquiry;
17  
18  import edu.samplu.common.Failable;
19  import edu.samplu.common.ITUtil;
20  import edu.samplu.common.WebDriverLegacyITBase;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public abstract class DemoTravelAccountInquirySmokeTestBase extends WebDriverLegacyITBase {
26  
27      /**
28       * //a[@title='Travel Account ']
29       */
30      public static final String ANCHOR_TITLE_TRAVEL_ACCOUNT = "//a[@title='Travel Account ']";
31  
32      /**
33       * /kr-krad/inquiry?methodToCall=start&number=a14&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount
34       */
35      public static final String BOOKMARK_URL = "/kr-krad/inquiry?methodToCall=start&number=a14&dataObjectClassName=org.kuali.rice.krad.demo.travel.account.TravelAccount";
36  
37      /**
38       * Collapse All
39       */
40      public static final String COLLAPSE_ALL = "Collapse All";
41  
42      /**
43       * Expand All
44       */
45      public static final String EXPAND_ALL = "Expand All";
46  
47      @Override
48      public String getTestUrl() {
49          return ITUtil.KRAD_PORTAL;
50      }
51  
52      protected void navigation() throws Exception {
53          waitAndClickById("Demo-DemoLink", "");
54          waitAndClickByLinkText("Account Inquiry");
55      }
56  
57      protected void testInquiryBackButton() throws Exception {
58          waitAndClickButtonByText("Back");
59          waitForElementPresentByClassName("uif-headerText");
60          assertTextPresent("Demo - Travel Application");
61      }
62  
63      public void testInquiryBackButtonBookmark(Failable failable) throws Exception {
64          testInquiryBackButton();
65          passed();
66      }
67  
68      public void testInquiryBackButtonNav(Failable failable) throws Exception {
69          navigation();
70          testInquiryBackButton();
71          passed();
72      }
73  
74      protected void testCollapseExpand() throws InterruptedException {
75          assertTextPresent("Travel Account Number:");
76          assertTextPresent(EXPAND_ALL);
77          assertTextPresent(COLLAPSE_ALL);
78          assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
79  
80          waitAndClickButtonByText(COLLAPSE_ALL);
81          assertIsNotVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + COLLAPSE_ALL);
82  
83          waitAndClickButtonByText(EXPAND_ALL);
84          assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, " after clicking " + EXPAND_ALL);
85      }
86  
87      public void testInquiryCollapseExpandBookmark(Failable failable) throws Exception {
88          testCollapseExpand();
89          passed();
90      }
91  
92      public void testInquiryCollapseExpandNav(Failable failable) throws Exception {
93          navigation();
94          testCollapseExpand();
95          passed();
96      }
97  
98      protected void testInquiryLightBox() throws Exception {
99          waitAndClickByLinkText("a6");
100         assertIsVisibleByXpath(ANCHOR_TITLE_TRAVEL_ACCOUNT, "");
101     }
102 
103     public void testInquiryLightBoxBookmark(Failable failable) throws Exception {
104         testInquiryLightBox();
105         passed();
106     }
107 
108     public void testInquiryLightBoxNav(Failable failable) throws Exception {
109         navigation();
110         testInquiryLightBox();
111         passed();
112     }
113 }