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.travel.krad.test;
17  
18  import edu.samplu.common.Failable;
19  import edu.samplu.common.ITUtil;
20  import edu.samplu.common.WebDriverLegacyITBase;
21  
22  /**
23   * Tests the Component section in Rice.
24   *
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public abstract class ConfigurationTestViewAbstractSmokeTestBase extends WebDriverLegacyITBase {
28  
29      /**
30       * "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView&methodToCall=start";
31       */
32      public static final String BOOKMARK_URL = "/kr-krad/configuration-test-view-uif-controller?viewId=ConfigurationTestView&methodToCall=start";
33      
34      /** bean id prefix in used in view */
35      private String idPrefix = "ConfigurationTestView-ProgressiveRender-";
36  
37      /** bean id suffix for add line controls */
38      String addLineIdSuffix = "InputField_add_control";
39  
40  
41      protected void bookmark() {
42          open(ITUtil.getBaseUrlString() + BOOKMARK_URL);
43      }
44  
45      /**
46       * Nav tests start at {@link edu.samplu.common.ITUtil#PORTAL}.
47       * Bookmark Tests should override and return {@link edu.samplu.travel.krad.test.ConfigurationTestViewAbstractSmokeTestBase#BOOKMARK_URL}
48       * {@inheritDoc}
49       * @return
50       */
51      @Override
52      public String getTestUrl() {
53          return ITUtil.PORTAL;
54      }
55  
56      protected void navigation() throws InterruptedException {
57          waitAndClickKRAD();
58          waitAndClickByXpath("(//a[text()='Configuration Test View'])");
59          switchToWindow(CONFIGURATION_VIEW_WINDOW_TITLE);
60          waitForTitleToEqualKualiPortalIndex();   
61      }
62  
63      protected void testConfigurationTestViewNav(Failable failable) throws Exception {     
64          navigation();
65          testConfigurationTestView(idPrefix);
66          testAddLineWithSpecificTime(idPrefix, addLineIdSuffix);
67          testAddLineWithAllDay(idPrefix, addLineIdSuffix);
68          testAddLineAllDay(idPrefix, addLineIdSuffix);
69          passed();
70      }
71  
72      protected void testConfigurationTestViewBookmark(Failable failable) throws Exception {
73          testConfigurationTestView(idPrefix);
74          testAddLineWithSpecificTime(idPrefix, addLineIdSuffix);
75          testAddLineWithAllDay(idPrefix, addLineIdSuffix);
76          testAddLineAllDay(idPrefix, addLineIdSuffix);
77          passed();
78      }
79  }