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 edu.sampleu.kew;
17  
18  import edu.sampleu.admin.ConfigComponentActionListBkMrkAft;
19  import org.junit.Test;
20  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
22  import org.kuali.rice.testtools.selenium.WebDriverUtils;
23  
24  /**
25   * Tests the Component section in Rice.
26   *
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class QuickLinksAft extends WebDriverLegacyITBase {
30  
31      /**
32       * AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Quicklinks&channelUrl="
33       * + WebDriverUtils.getBaseUrlString() + "/kew/QuickLinks.do";
34       */
35      public static final String BOOKMARK_URL =
36              AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Quicklinks&channelUrl=" + WebDriverUtils
37                      .getBaseUrlString() + "/kew/QuickLinks.do";
38  
39      @Override
40      protected String getBookmarkUrl() {
41          return BOOKMARK_URL;
42      }
43  
44      @Override
45      protected void navigate() throws InterruptedException {
46          waitAndClickMainMenu();
47          waitAndClickByLinkText("Quicklinks");
48      }
49  
50      protected void testQuickLinks() throws Exception {
51          selectFrameIframePortlet();
52          assertTextPresent(new String[] {"Named Searches", "Quick EDoc Search", "Quick EDoc Watch", "Quick Action List"});
53  
54          String rootWindow = driver.getWindowHandle();
55  
56          ConfigComponentActionListBkMrkAft test = new ConfigComponentActionListBkMrkAft();
57          test.setTestMethodName("QuickLinksAft." + testMethodName);
58          test.setUpSetUp();
59          test.setDriver(getDriver()); // Use this tests WebDriver as the tests own has not been setup
60          open(getBaseUrlString() + test.getBookmarkUrl());
61          test.testActionListAcknowledgePerson_WithPendingApprove();
62          close(); // action list window
63          driver.switchTo().window(rootWindow);
64          logout(); // as fran
65  
66          open(getBaseUrlString() + getBookmarkUrl());
67          selectFrameIframePortlet();
68          assertTextPresent(new String[] {"ENROUTE", "Route Log"});
69      }
70  
71      @Test
72      public void testQuickLinksBookmark() throws Exception {
73          testQuickLinks();
74          passed();
75      }
76  
77      @Test
78      public void testQuickLinksNav() throws Exception {
79          testQuickLinks();
80          passed();
81      }
82  }