View Javadoc
1   /**
2    * Copyright 2005-2014 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  import org.openqa.selenium.By;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class LabsTravelCompanyLookUpDisableNewAndCopyAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/uicomponents?viewId=Lab-NativeAutocomplete-DisableField
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR1C2";
31  
32      @Override
33      protected String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          waitAndClickByLinkText("Maintenance");
40      	waitAndClickByLinkText("Maintenance Sample - Disable New and Copy");
41      }
42  
43      protected void testTravelCompanyLookUpDisableNewAndCopy() throws InterruptedException {
44      	waitAndClickByLinkText("Travel Company Maintenance Sample - Disable New and Copy");
45      	waitAndTypeByName("lookupCriteria[travelCompanyId]","10000");
46          waitAndClickSearchByText();
47      	waitForElementPresentByXpath("//a[contains(text(),'10000')]");
48      	waitAndClickButtonByText("Clear Values");
49      	waitAndTypeByName("lookupCriteria[travelCompanyName]","AAA Travel");
50      	waitAndClickByXpath("//input[@name='lookupCriteria[active]' and @value='N']");
51          waitAndClickSearchByText();
52      	waitForElementPresentByXpath("//a[contains(text(),'10001')]");
53      	waitForTextPresent("AAA Travel");
54      	waitForElementNotPresent(By.xpath("//a[contains(text(),'copy')]"));
55      	waitForElementNotPresent(By.xpath("//a[contains(text(),'create new')]"));
56      }
57  
58      @Test
59      public void testTravelCompanyLookUpDisableNewAndCopyBookmark() throws Exception {
60      	testTravelCompanyLookUpDisableNewAndCopy();
61          passed();
62      }
63  
64      @Test
65      public void testTravelCompanyLookUpDisableNewAndCopyNav() throws Exception {
66      	testTravelCompanyLookUpDisableNewAndCopy();
67          passed();
68      }
69  }