View Javadoc
1   /**
2    * Copyright 2005-2015 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.admin;
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 AdminTmplMthdAftNavBase extends NavTemplateMethodAftBase {
26  
27      public static final String CREATE_NEW_LOCATOR = "//img[contains(@alt,'create new')]";
28  //    public static final String CREATE_NEW_LOCATOR = "//a[contains(@href,'command=initiate')]"; // not with IE8
29  //    public static final String CREATE_NEW_LOCATOR = "//a[@title='Create a new record']"; // not with IE8
30      public static final String ADMIN_LOCATOR = "Administration";
31      public static final String SPAN_CLASS_PAGEBANNER = "//span[@class='pagebanner']";
32  
33      @Override
34      protected String getCreateNewLinkLocator() {
35          return CREATE_NEW_LOCATOR;
36      }
37  
38      @Override
39      protected String getMenuLinkLocator() {
40          return ADMIN_LOCATOR;
41      }
42  
43      /**
44       * tests that a getLinkLocator maintenance document can be cancelled
45       */
46      public void testCreateNewCancelNav() throws Exception {
47          gotoCreateNew();
48          testCancelConfirmation();
49      }
50  
51      /**
52       * tests that a getLinkLocator maintenance document is created for an edit operation originating from a lookup screen
53       */
54      public void testEditCancel() throws Exception {
55          testSearchEditCancel();
56      }
57  
58      public void testSearchEditBack(JiraAwareFailable failable) throws Exception {
59          waitAndClickSearch2();
60          waitAndClickByLinkText("edit");
61          waitFor(By.name(BLANKET_APPROVE_NAME));
62          back();
63          waitForTextPresent(getTextByXpath(SPAN_CLASS_PAGEBANNER));
64      }
65  
66      public void testSearchSearchBack(JiraAwareFailable failable, String fieldName, String searchText) throws Exception {
67          waitAndClickSearch2();
68          waitAndTypeByName(fieldName, searchText);
69          waitAndClickSearch2();
70          back();
71          waitForTextPresent(getTextByXpath(SPAN_CLASS_PAGEBANNER));
72      }
73  }