View Javadoc
1   /**
2    * Copyright 2005-2016 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  import org.openqa.selenium.WebElement;
22  
23  /**
24   * This class test the functionality of property editors in collection field inputs
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   */
28  public class LabsCollectionAddLineWithPropertyEditorAft extends WebDriverLegacyITBase {
29  
30      public static final String BOOKMARK_URL = "/kr-krad/travelAccountCollection?viewId=Lab-CollectionAddLineWithPropertyEditor";
31  
32      // Travel Account Collection Table with add line
33      By acctNameInputLoc = By.xpath("//table/tbody/tr/td[2]/div/input");
34      By acctNumInputLoc = By.xpath("//table/tbody/tr/td[3]/div/div/input");
35      By acctTypeCdInputLoc = By.xpath("//table/tbody/tr/td[4]/div/div/input");
36      By addButtonLoc = By.id("Lab-CollectionAddLineWithPropertyEditor-Table_add");
37  
38  
39      @Override
40      protected String getBookmarkUrl() {
41          return BOOKMARK_URL;
42      }
43  
44      @Override
45      protected void navigate() throws Exception {
46          waitAndClickByLinkText("Collection Add Line: Using Property Editor");
47      }
48  
49      protected void testDemoCollectionAddLineWithPropertyEditor() throws InterruptedException {
50          waitAndType(acctNameInputLoc,"testcase");
51          waitAndType(acctNumInputLoc,"asd");
52          waitAndType(acctTypeCdInputLoc,"CAT");
53          waitAndClick(addButtonLoc);
54          waitForTextPresent("tes-tcase");
55      }
56  
57      @Test
58      public void testDemoCollectionAddLineWithPropertyEditorBookmark() throws Exception {
59          testDemoCollectionAddLineWithPropertyEditor();
60          passed();
61      }
62  
63      @Test
64      public void testDemoCollectionAddLineWithPropertyEditorNav() throws Exception {
65          testDemoCollectionAddLineWithPropertyEditor();
66          passed();
67      }
68  
69  
70  }