View Javadoc

1   /**
2    * Copyright 2005-2011 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.common;
17  
18  import org.junit.Test;
19  
20  /**
21   * @deprecated Use WebDriverITBase for new tests.
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  
25  public abstract class AdminMenuITBase extends MenuITBase {
26  
27      public static final String LABEL_KUALI_KUALI_SYSTEMS = "label=KUALI - Kuali Systems";
28      public static final String LABEL_KUALI_DEFAULT = "label=KUALI : Default";
29      public static final String CREATE_NEW_LOCATOR = "//img[@alt='create new']";
30      public static final String ADMIN_LOCATOR = "link=Administration";
31      public static final String DOC_ID_LOCATOR = "//div[@id='headerarea']/div/table/tbody/tr[1]/td[1]";
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      @Test
44      /**
45       * tests that a getLinkLocator maintenance document can be cancelled
46       */
47      public void testCreateNewCancel() throws Exception {
48          gotoCreateNew();
49          waitAndClick("methodToCall.cancel");
50          waitAndClick("methodToCall.processAnswer.button0");
51          waitForPageToLoad();
52      }
53  
54      @Test
55      /**
56       * tests that a getLinkLocator maintenance document is created for an edit operation originating from a lookup screen
57       */
58      public void testEditCancel() throws Exception {
59          gotoMenuLinkLocator();
60          waitAndClick("//input[@name='methodToCall.search' and @value='search']");
61          waitAndClick("link=edit");
62          waitAndClick("methodToCall.cancel");
63          waitAndClick("methodToCall.processAnswer.button0");
64          waitForPageToLoad();
65      }
66  }