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.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 class EmploymentStatusAft extends WebDriverLegacyITBase {
29  
30      /**
31       *  AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Employment%20Status&channelUrl="
32       *   + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
33       *   "org.kuali.rice.kim.impl.identity.employment.EntityEmploymentStatusBo&docFormKey=88888888&returnLocation="
34       *   + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
35       */
36      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Employment%20Status&channelUrl="
37              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
38              "org.kuali.rice.kim.impl.identity.employment.EntityEmploymentStatusBo&docFormKey=88888888&returnLocation="
39              + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
40           
41      @Override
42      protected String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      @Override
47      protected void navigate() throws InterruptedException {
48          waitAndClickKRAD();
49          waitAndClickByLinkText("Employment Status");
50      }
51  
52      //Code for KRAD Test Package.
53      protected void testEmploymentStatus() throws Exception {
54          selectFrameIframePortlet();
55          waitAndClickClearValues();
56  
57          //Search by "Both" Filter in Active Indicator
58          clickSearch();
59          String[][] data = {{"A", "Active", "01","true"},
60                  {"D", "Deceased", "99","true"}};
61          assertTextPresent(data);
62          waitAndClickClearValues();
63  
64          //Search by "Yes" Filter in Active Indicator
65          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
66          clickSearch();
67          assertTextPresent(data);
68          waitAndClickClearValues();
69  
70          //Search by "No" Filter in Active Indicator
71          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
72          clickSearch();
73          waitForTextPresent("No values match this search.");
74          waitAndClickClearValues();
75  
76          //Search by Code Filter
77          waitAndTypeByName("lookupCriteria[code]","A");
78          clickSearch();
79          String[] assertSearchResultForTypeCode = {"A", "Active", "01","true"};
80          assertTextPresent(assertSearchResultForTypeCode);
81          waitAndClickClearValues();
82  
83          //Search by Name Filter
84          waitAndTypeByName("lookupCriteria[name]","Active");
85          clickSearch();
86          String[] assertSearchResultForTypeName = {"A", "Active", "01","true"};
87          assertTextPresent(assertSearchResultForTypeName);
88          waitAndClickClearValues();
89  
90          //Search by Short Code Filter
91          waitAndTypeByName("lookupCriteria[sortCode]","01");
92          clickSearch();
93          String[] assertSearchResultForShortCode = {"A", "Active", "01","true"};
94          assertTextPresent(assertSearchResultForShortCode);
95          waitAndClickClearValues();
96      }
97  
98      protected void clickSearch() throws InterruptedException {
99          waitAndClickSearchByText();
100     }
101 
102     @Test
103     public void testEmploymentStatusBookmark() throws Exception {
104         testEmploymentStatus();
105         passed();
106     }
107 
108     @Test
109     public void testEmploymentStatusNav() throws Exception {
110         testEmploymentStatus();
111         passed();
112     }
113 }