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.travelapplication.accountmultivalue.lookup;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.SmokeTestBase;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoTravelAccountMultivalueLookUpSmokeTest extends SmokeTestBase {
26  
27      /**
28       * /kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true&multipleValuesSelect=true&suppressActions=true&conversionFields=number:foo,name:foo
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true&multipleValuesSelect=true&suppressActions=true&conversionFields=number:foo,name:foo";
31     
32      /**
33       * lookupCriteria[accountTypeCode]
34       */
35      public static final String ACCOUNT_TYPE_CODE_NAME = "lookupCriteria[accountTypeCode]";
36  
37      @Override
38      public String getBookmarkUrl() {
39          return BOOKMARK_URL;
40      }
41  
42      @Override
43      protected void navigate() throws Exception {
44          waitAndClickById("Demo-DemoLink", "");
45          waitAndClickByLinkText("Account Multi-Value Lookup");
46      }
47  
48      private void testSearchSelect() throws InterruptedException {
49          waitAndClickByValue("CAT");
50          waitAndClickButtonByText(WebDriverLegacyITBase.SEARCH);
51          waitAndClickByName("selectedCollectionLines['lookupResults']");
52          assertTextPresent("a14");
53          assertTextPresent("a6");
54          assertTextPresent("a9");
55          assertButtonEnabledByText(WebDriverLegacyITBase.RETURN_SELECTED_BUTTON_TEXT);
56          waitAndClickByName("selectedCollectionLines['lookupResults']");
57          assertButtonDisabledByText(WebDriverLegacyITBase.RETURN_SELECTED_BUTTON_TEXT);
58  
59          assertMultiValueSelectAllThisPage();
60          assertMultiValueDeselectAllThisPage();
61  
62          waitAndClickByName("selectedCollectionLines['lookupResults']");
63          waitAndClickButtonByText(WebDriverLegacyITBase.SEARCH);
64          checkForIncidentReport();
65      }
66  
67      @Test
68      public void testTravelAccountMultivalueLookUpSearchSelectBookmark() throws Exception {
69          testSearchSelect();
70          passed();
71      }
72  
73      @Test
74      public void testTravelAccountMultivalueLookUpSearchSelectNav() throws Exception {
75          testSearchSelect();
76          passed();
77      }
78  
79      @Test
80      public void testTravelAccountMultivalueLookUpSelectThisPageBookmark() throws Exception {
81          testMultiValueSelectAllThisPage();
82          passed();
83      }
84  
85      @Test
86      public void testTravelAccountMultivalueLookUpSelectThisPageNav() throws Exception {
87          testMultiValueSelectAllThisPage();
88          passed();
89      }
90  
91      @Test
92      public void testTravelAccountMultivalueLookUpSelectAllPagesBookmark() throws Exception {
93          testMultiValueSelectAllPages();
94          passed();
95      }
96  
97      @Test
98      public void testTravelAccountMultivalueLookUpSelectAllPagesNav() throws Exception {
99          testMultiValueSelectAllPages();
100         passed();
101     }
102 }