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.demo.uif.library.collections;
17  
18  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
19  import org.junit.Test;
20  import org.openqa.selenium.By;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class LibraryCollectionFeaturesMultiValueLookupAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/kradsampleapp?viewId=Demo-LightTableView&methodToCall=start
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-CollectionLookupView&methodToCall=start";
31  
32      @Override
33      protected String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      @Override
38      protected void navigate() throws Exception {
39          jGrowl("Click the Library Link");
40          waitAndClickLibraryLink();
41          waitAndClickByLinkText("Collection Features");
42          waitAndClickByLinkText("Multi-Value Lookup");
43      }
44  
45      protected void testMultiValueLookup() throws InterruptedException {
46          lightBoxLookupAddMultipleLines();
47  
48          waitAndTypeByName("lookupCriteria[number]", "a1");
49          waitAndClickSearchByText();
50          assertButtonDisabledByText("return selected");
51  
52          jGrowl("Check Travel Account 1 checkbox");
53          waitAndClickByValue("IAT:Travel Account 1:a1");
54          assertButtonEnabledByText("return selected");
55  
56          jGrowl("Uncheck Travel Account 1 checkbox");
57          waitAndClickByValue("IAT:Travel Account 1:a1");
58          assertButtonDisabledByText("return selected");
59  
60          waitAndClickButtonByText("return selected");
61          Thread.sleep(3000);
62          assertTextPresent("a1"); // TODO better assertion once NullPointer is resolved
63      }
64  
65      private void lightBoxLookupAddMultipleLines() throws InterruptedException {
66          waitAndClickByLinkText("Lookup/Add Multiple Lines");
67          gotoLightBox();
68          gotoLightBoxIframe();
69      }
70  
71      @Test
72      public void testMultiValueLookupBookmark() throws InterruptedException {
73          testMultiValueLookup();
74          passed();
75      }
76  
77      @Test
78      public void testMultiValueLookupNav() throws InterruptedException {
79          testMultiValueLookup();
80          passed();
81      }
82  
83      @Test
84      public void testMultivalueLookUpSelectThisPageBookmark() throws Exception {
85          lightBoxLookupAddMultipleLines();
86          testMultiValueSelectAllThisPage();
87          passed();
88      }
89  
90      @Test
91      public void testMultivalueLookUpSelectThisPageNav() throws Exception {
92          lightBoxLookupAddMultipleLines();
93          testMultiValueSelectAllThisPage();
94          passed();
95      }
96  
97      @Test
98      public void testMultivalueLookUpSelectAllPagesBookmark() throws Exception {
99          lightBoxLookupAddMultipleLines();
100         testMultiValueSelectAllPages();
101         passed();
102     }
103 
104     @Test
105     public void testMultivalueLookUpSelectAllPagesNav() throws Exception {
106         lightBoxLookupAddMultipleLines();
107         testMultiValueSelectAllPages();
108         passed();
109     }
110 }