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.demo.uif.library.collections;
17  
18  import org.junit.Test;
19  
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class LibraryCollectionFeaturesSelectLineAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/kradsampleapp?viewId=Demo-CollectionSelectLineView
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CollectionSelectLineView";
31  
32      @Override
33      protected String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          waitAndClickLibraryLink();
40          waitAndClickByLinkText("Collection Features");
41          waitAndClickByLinkText("Select Line");
42      }
43  
44      protected void testCollectionFeaturesSelectLine() throws Exception {
45          selectByName("exampleShown", "Line Selection");
46  
47          waitAndClickByXpath("//input[@name='collection1[0].bfield']");
48          assertElementPresentByXpath("//input[@name='collection1[0].bfield' and @value='collection1[0]']");
49  
50          waitAndClickByXpath("//input[@name='collection1[2].bfield']");
51          assertElementPresentByXpath("//input[@name='collection1[2].bfield' and @value='collection1[2]']");
52      }
53  
54      protected void testCollectionFeaturesSelectLineExpressionVariable() throws Exception {
55          selectByName("exampleShown", "Line Selection with Expression Variable");
56  
57          waitAndClickByXpath("//input[@name='collection2[0].bfield']");
58          assertElementPresentByXpath("//input[@name='collection2[0].bfield' and @value='0']");
59  
60          waitAndClickByXpath("//input[@name='collection2[2].bfield']");
61          assertElementPresentByXpath("//input[@name='collection2[2].bfield' and @value='2']");
62      }
63  
64      @Test
65      public void testCollectionFeaturesSelectLineBookmark() throws Exception {
66          testCollectionFeaturesSelectLine();
67          passed();
68      }
69  
70      @Test
71      public void testCollectionFeaturesSelectLineExpressionVariableBookmark() throws Exception {
72          testCollectionFeaturesSelectLineExpressionVariable();
73          passed();
74      }
75  
76      @Test
77      public void testCollectionFeaturesSelectLineNav() throws Exception {
78          testCollectionFeaturesSelectLine();
79          passed();
80      }
81  
82      @Test
83      public void testCollectionFeaturesSelectLineExpressionVariableNav() throws Exception {
84          testCollectionFeaturesSelectLineExpressionVariable();
85          passed();
86      }
87  
88  }