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 org.kuali.rice.krad.labs;
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  public class LabsQuickFinderCallbackAft extends WebDriverLegacyITBase {
25  
26      /**
27       * /kr-krad/quickfinder?viewId=Lab-QuickFinderCallback
28       */
29      public static final String BOOKMARK_URL = "/kr-krad/quickfinder?viewId=Lab-QuickFinderCallback";
30      
31      @Override
32      protected String getBookmarkUrl() {
33          return BOOKMARK_URL;
34      }
35  
36      @Override
37      protected void navigate() throws Exception {
38      	waitAndClickByLinkText("QuickFinder Callback");
39      }
40  
41      protected void testDemoQuickFinderCallback() throws Exception {
42          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Table5']/div/table/tbody/tr/td[3]/div/div/div/button");
43          testLookUpSearchReturn();
44          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Table4']/div/table/tbody/tr/td[3]/div/div/div/button");
45          testLookUpSearchReturn();
46          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Table3']/div/table/tbody/tr/td[3]/div/div/div/button");
47          testLookUpSearchReturn();
48          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Grid1']/table/tbody/tr/td/div/div/div/button");
49          testLookUpSearchReturn();
50          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Table1']/div/table/tbody/tr/td[3]/div/div/div/button");
51          testLookUpSearchReturn();
52          waitAndClickByXpath("//section[@id='Lab-QuickFinder-Table2']/div/table/tbody/tr/td[3]/div/div/div/button");
53          testLookUpSearchReturn();
54      }
55      
56      private void testLookUpSearchReturn() throws Exception {
57      	gotoLightBox();
58      	waitAndClickButtonByExactText("Search");
59      	waitAndClickByLinkText("return value");
60      }
61  
62      @Test
63      public void testDemoQuickFinderCallbackBookmark() throws Exception {
64      	testDemoQuickFinderCallback();
65          passed();
66      }
67  
68      @Test
69      public void testDemoQuickFinderCallbackNav() throws Exception {
70      	testDemoQuickFinderCallback();
71          passed();
72      }
73  }