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.uif.library;
17  
18  import com.thoughtworks.selenium.SeleneseTestBase;
19  import edu.samplu.krad.demo.uif.library.DemoLibraryBase;
20  import org.junit.Test;
21  import edu.samplu.common.SmokeTestBase;
22  import org.kuali.rice.krad.uif.UifConstants;
23  import org.openqa.selenium.By;
24  import org.openqa.selenium.WebElement;
25  import org.openqa.selenium.interactions.Actions;
26  
27  import java.util.List;
28  
29  /**
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   */
32  public class DemoLibraryWidgetsHelpSmokeTest extends DemoLibraryBase {
33  
34      /**
35       * /kr-krad/kradsampleapp?viewId=Demo-Help-View&methodToCall=start
36       */
37      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=Demo-Help-View&methodToCall=start";
38  
39      @Override
40      protected String getBookmarkUrl() {
41          return BOOKMARK_URL;
42      }
43  
44      @Override
45      protected void navigate() throws Exception {
46          waitAndClickById("Demo-LibraryLink", "");
47          waitAndClickByLinkText("Widgets");
48          waitAndClickByLinkText("Help");
49      }
50  
51      protected void testWidgetsTooltipHelp() throws Exception {
52  
53          fireMouseOverEvent(By.id("Demo-Help-Field1_label"));
54          WebElement helpExample1 = driver.findElement(By.xpath("//div[@data-for=\"Demo-Help-Field1_label\"]"))
55                  .findElement(By.className("jquerybubblepopup-innerHtml"));
56          if (!helpExample1.isDisplayed()) {
57              fail("Example 1 help not displayed.");
58          }
59          if (!helpExample1.getText().equals("Sample text for field help - label left")) {
60              fail("Incorrect inner html text.");
61          }
62      }
63  
64      @Test
65      public void testWidgetsHelpBookmark() throws Exception {
66          testWidgetsTooltipHelp();
67  
68          driver.close();
69          passed();
70      }
71  
72      @Test
73      public void testWidgetsHelpNav() throws Exception {
74          testWidgetsTooltipHelp();
75  
76          driver.close();
77          passed();
78      }
79  }