View Javadoc

1   /**
2    * Copyright 2005-2013 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.krad.demo.lookup.resultlimit;
17  
18  import edu.samplu.common.SmokeTestBase;
19  import org.junit.Ignore;
20  import org.junit.Test;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoSampleLookUpResultLimitSmokeTest extends SmokeTestBase {
26  
27      /**
28       * /kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewResultsLimit&hideReturnLink=true
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=LookupSampleViewResultsLimit&hideReturnLink=true";
31  
32      /**
33       * Search
34       */
35      public static final String SEARCH = "Search";
36  
37      @Override
38      protected String getBookmarkUrl() {
39          return BOOKMARK_URL;
40      }
41  
42      @Override
43      protected void navigate() throws Exception {
44          waitAndClickById("Demo-DemoLink", "");
45          waitAndClickByLinkText("Lookup Results Limit");
46      }
47  
48      protected void testDemoSampleLookUpResultLimit() throws Exception {
49          waitAndTypeByName("lookupCriteria[number]", "a*");
50          waitAndClickButtonByText(SEARCH);
51          Thread.sleep(3000);
52          if(isElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr[3]")) {
53              fail("Search Results contains more than 2 rows.");
54          }
55      }
56  
57      @Ignore // this demo page has been removed
58      @Test
59      public void testDemoSampleLookUpResultLimitNav() throws Exception {
60          testDemoSampleLookUpResultLimit();
61          passed();
62      }
63  
64      @Ignore // this demo page has been removed
65      @Test
66      public void testDemoDemoSampleLookUpResultLimitBookmark() throws Exception {
67          testDemoSampleLookUpResultLimit();
68          passed();
69      }
70  }