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.krad.reference;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  
25  public abstract class TypeBaseAft extends WebDriverLegacyITBase {
26  
27      protected abstract String[][] getData();
28  
29      //Code for KRAD Test Package.
30      protected void testEntityType() throws Exception {
31          selectFrameIframePortlet();
32          waitAndClickClearValues();
33  
34          //Search by "Both" Filter in Active Indicator
35          clickSearch();
36          assertTextPresent(getData());
37          waitAndClickClearValues();
38  
39          //Search by "Yes" Filter in Active Indicator
40          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
41          clickSearch();
42          assertTextPresent(getData());
43          waitAndClickClearValues();
44  
45          //Search by "No" Filter in Active Indicator
46          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
47          clickSearch();
48          waitForTextPresent("No values match this search.");
49          waitAndClickClearValues();
50  
51          //Search by Code Filter
52          waitAndTypeByName("lookupCriteria[code]",getData()[0][0]);
53          clickSearch();
54          assertTextPresent(getData()[0]);
55          waitAndClickClearValues();
56  
57          //Search by Name Filter
58          waitAndTypeByName("lookupCriteria[name]",getData()[0][1]);
59          clickSearch();
60          assertTextPresent(getData()[0]);
61          waitAndClickClearValues();
62      }
63  
64      protected void clickSearch() throws InterruptedException {
65          waitAndClickSearchByText();
66          waitForProgressLoading();
67      }
68  
69      @Test
70      public void testTypeBookmark() throws Exception {
71          testEntityType();
72          passed();
73      }
74  
75      @Test
76      public void testTypeNav() throws Exception {
77          testEntityType();
78          passed();
79      }
80  
81  }