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 ExternalIdentifierTypeAft extends WebDriverLegacyITBase {
29  
30      /**
31       *   AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=External%20Identifier%20Type&channelUrl="
32       *   + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
33       *   "org.kuali.rice.kim.impl.identity.external.EntityExternalIdentifierTypeBo&returnLocation="
34       *   + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
35       */
36      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=External%20Identifier%20Type&channelUrl="
37              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD +
38              "org.kuali.rice.kim.impl.identity.external.EntityExternalIdentifierTypeBo&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("External Identifier Type");
50      }
51  
52      //Code for KRAD Test Package.
53      protected void testExternalIdentifierType() throws Exception {
54          selectFrameIframePortlet();
55          waitAndClickClearValues();
56  
57          //Search by "Both" Filter in Active Indicator
58          clickSearch();
59          waitForTextPresent("LOGON");
60          String[][] data = {{"LOGON", "Logon ID", "01","true"},
61                  {"RFID", "RFID Implant", "07","true"}};
62          assertTextPresent(data);
63          waitAndClickClearValues();
64  
65          //Search by "Yes" Filter in Active Indicator
66          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='Y']");
67          clickSearch();
68          assertTextPresent(data);
69          waitAndClickClearValues();
70  
71          //Search by "No" Filter in Active Indicator
72          waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
73          clickSearch();
74          waitForTextPresent("No values match this search.");
75          waitAndClickClearValues();
76  
77          //Search by Code Filter
78          waitAndTypeByName("lookupCriteria[code]","LOGON");
79          clickSearch();
80          String[] assertSearchResultForTypeCode = {"LOGON", "Logon ID", "01","true"};
81          waitForTextPresent("LOGON");
82          assertTextPresent(assertSearchResultForTypeCode);
83          waitAndClickClearValues();
84  
85          //Search by Name Filter
86          waitAndTypeByName("lookupCriteria[name]","Logon ID");
87          clickSearch();
88          String[] assertSearchResultForTypeName = {"LOGON", "Logon ID", "01","true"};
89          assertTextPresent(assertSearchResultForTypeName);
90          waitAndClickClearValues();
91      }
92  
93      protected void clickSearch() throws InterruptedException {
94          waitAndClickSearchByText();
95      }
96  
97      @Test
98      public void testExternalIdentifierTypeBookmark() throws Exception {
99          testExternalIdentifierType();
100         passed();
101     }
102 
103     @Test
104     public void testExternalIdentifierTypeNav() throws Exception {
105         testExternalIdentifierType();
106         passed();
107     }
108 }