View Javadoc
1   /**
2    * Copyright 2005-2014 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.sampleu.travel;
17  
18  import org.kuali.rice.testtools.common.JiraAwareFailable;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  
23  /**
24   * Tests the Component section in Rice.
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public abstract class TravelAccountLookupAftBase extends WebDriverLegacyITBase {
29  
30      /**
31       * "/portal.do?channelTitle=Travel%20Account%20Lookup&channelUrl="
32       * + WebDriverUtils.getBaseUrlString() + ITUtil.KRAD_LOOKUP_METHOD
33       * + "edu.sampleu.travel.bo.TravelAccount&returnLocation="
34       * + ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK + ITUtil.SHOW_MAINTENANCE_LINKS
35       */
36      public static final String BOOKMARK_URL = "/portal.do?channelTitle=Travel%20Account%20Lookup&channelUrl="
37              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD
38              + "edu.sampleu.travel.bo.TravelAccount&returnLocation="
39              + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK + AutomatedFunctionalTestUtils.SHOW_MAINTENANCE_LINKS;
40  
41      @Override
42      protected String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      protected void navigation() throws InterruptedException {
47          waitAndClickKRAD();
48          waitAndClickByLinkText(TRAVEL_ACCOUNT_LOOKUP_LINK_TEXT);
49      }
50  
51      protected void testTravelAccountLookupNav(JiraAwareFailable failable) throws Exception {
52          navigation();
53          testTravelAccountLookup();
54          passed();
55      }
56  
57      protected void testTravelAccountLookupBookmark(JiraAwareFailable failable) throws Exception {
58          testTravelAccountLookup();
59          passed();
60      }
61  
62      protected void testTravelAccountLookup() throws Exception {
63          selectFrameIframePortlet();
64  
65          //Blank Search
66          waitAndClickByXpath(SEARCH_XPATH_3);
67          Thread.sleep(2000);
68  
69          //  --------------------------------Further code will not run due to page exception------------------------------------
70          //assertElementPresentByLinkText("a1");
71          //ssertElementPresentByLinkText("a2");
72          //assertElementPresentByLinkText("a3");
73  
74          //QuickFinder Lookup
75          //waitAndTypeByName("lookupCriteria[number]", "a*");
76          //waitAndClickByXpath("//*[@id='u18']");
77          //Thread.sleep(2000);
78          //assertElementPresentByLinkText("a1");
79          //assertElementPresentByLinkText("a2");
80          //assertElementPresentByLinkText("a3");
81          //waitAndClickByXpath("//button[@id='u19']");
82          //Thread.sleep(2000);
83  
84          //search with each field
85          //waitAndTypeByName("lookupCriteria[number]", "a2");
86          //waitAndClickByXpath("//*[@id='u18']");
87          //Thread.sleep(2000);
88          //assertElementPresentByLinkText("a2");
89          //waitAndClickByXpath("//button[@id='u19']");
90          //Thread.sleep(2000);
91          // waitAndTypeByName("lookupCriteria[foId]", "1");
92          //waitAndClickByXpath("//*[@id='u18']");
93          //Thread.sleep(2000);
94          //assertEquals("1", getTextByXpath("//table[@id='u27']//tr//td[8]").trim().substring(0, 1));
95          //waitAndClickByXpath("//button[@id='u19']");
96          //Thread.sleep(2000);
97          //selectOptionByName("lookupCriteria[extension.accountTypeCode]", "CAT");
98          //waitAndClickByXpath("//*[@id='u18']");
99          //waitAndClickByXpath("//table[@id='u27']//tr//td[2]//a");
100         //Thread.sleep(2000);
101         //selectTopFrame();
102         //Thread.sleep(5000);
103         //gotoLightBox();
104         //assertEquals("Travel Account Inquiry", getTextByXpath("//h1/span").trim());
105         //assertEquals("CAT - Clearing Account Type", getTextByXpath("//*[@id='u44_control']").trim());
106         //waitAndClickByXpath("//button[@id='u13']");
107         //selectFrame("iframeportlet");
108     }
109 }