View Javadoc
1   /**
2    * Copyright 2005-2016 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.main;
17  
18  import edu.sampleu.common.NavTemplateMethodAftBase;
19  import org.kuali.rice.testtools.common.JiraAwareFailable;
20  import org.openqa.selenium.By;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public abstract class MainTmplMthdSTNavBase extends NavTemplateMethodAftBase {
26  
27      public static final String DATA_TABLES_INFO = "dataTables_info";
28  
29      @Override
30      protected String getCreateNewLinkLocator() {
31          return "Create New";
32      }
33  
34      @Override
35      protected String getMenuLinkLocator() {
36          return "Main Menu";
37      }
38  
39      protected void testSearchEditBack(JiraAwareFailable failable) throws Exception {
40          waitAndClickSearch3();
41          waitForElementPresentByClassName(DATA_TABLES_INFO);
42          String pageBannerText = getText(By.className(DATA_TABLES_INFO));
43          waitAndClickEdit();
44          waitForElementPresentByClassName("uif-headerText-span");
45          back();
46          waitForElementPresentByClassName(DATA_TABLES_INFO);
47          if (!pageBannerText.equals(getText(By.className(DATA_TABLES_INFO)))) {
48              failable.fail("https://jira.kuali.org/browse/KULRICE-9709 Search Edit Back does not show search results in Firefox");
49          }
50      }
51  
52      protected void testSearchSearchBack(JiraAwareFailable failable, String fieldName, String searchText) throws Exception {
53          waitAndClickSearch3();
54          waitForElementPresentByClassName(DATA_TABLES_INFO);
55          String pageBannerText = getText(By.className(DATA_TABLES_INFO));
56          waitAndTypeByName(fieldName, searchText);
57          waitAndClickSearch3();
58          waitForElementPresentByClassName(DATA_TABLES_INFO, "Problem with second search");
59          back();
60          acceptAlertIfPresent();
61          waitForElementsPresentByClassName(DATA_TABLES_INFO, "Going back from Search to Search results not available");
62          assertTextPresent("https://jira.kuali.org/browse/KULRICE-9710 Search Search back does not display first search results in Firefox", pageBannerText);
63      }
64  }