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.clientside.stateview;
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 LabsClientSideStateViewAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/labs?viewId=Lab-ClientSideState&formKey=ff000d97-13e9-4130-81a3-bc0217e8e0eb&
29       * cacheKey=otutyty24mo0f76n59ebqxvtpg&pageId=Lab-ClientSideState-Page1
30       */
31      public static final String BOOKMARK_URL = "/kr-krad/labs?viewId=Lab-ClientSideState&formKey=ff000d97-13e9-4130-81a3-bc0217e8e0eb&cacheKey=otutyty24mo0f76n59ebqxvtpg&pageId=Lab-ClientSideState-Page1";
32  
33      /**
34       * inactivatableCollection[0].active
35       */
36      private static final String ACTIVE_COMPONENT_NAME = "inactivatableCollection[0].active";
37  
38      /**
39       * inactivatableCollection[0].active
40       */
41      private static final String ACTIVE_COMPONENT2_NAME = "inactivatableCollection2[0].active";
42      
43      /**
44       * This overridden method ...
45       * 
46       * @see org.kuali.rice.testtools.selenium.AutomatedFunctionalTestBase#navigate()
47       */
48      @Override
49      protected void navigate() throws Exception {
50          // TODO deep - THIS METHOD NEEDS JAVADOCS
51          //Navigation is not defined for this functionality so we only do have URL in this Smoke Test.
52      }
53  
54      @Override
55      protected String getBookmarkUrl() {
56          return BOOKMARK_URL;
57      }
58  
59      @Test
60      public void testClientSideStateViewBookmark() throws Exception {
61          testClientSideStateView();
62      }
63  
64      public void testClientSideStateView() throws Exception {
65          waitAndClickByName(ACTIVE_COMPONENT_NAME);
66          waitAndClickByName(ACTIVE_COMPONENT2_NAME);
67          waitAndClickButtonByText("Refresh - Ajax");
68          Thread.sleep(2000);
69          waitForElementNotPresent(By.name(ACTIVE_COMPONENT_NAME));
70          assertFalse(isElementPresentByName(ACTIVE_COMPONENT_NAME));
71          assertFalse(isElementPresentByName(ACTIVE_COMPONENT2_NAME));
72          waitAndClickButtonByText("Refresh - Non-Ajax");
73          Thread.sleep(2000);
74          waitForElementNotPresent(By.name(ACTIVE_COMPONENT_NAME));
75          assertFalse(isElementPresentByName(ACTIVE_COMPONENT2_NAME));
76      }
77  }