View Javadoc
1   /**
2    * Copyright 2005-2016 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.demo.uif.library.containers;
17  
18  import com.thoughtworks.selenium.SeleneseTestBase;
19  import org.junit.Test;
20  import org.kuali.rice.krad.demo.uif.library.LibraryBase;
21  import org.kuali.rice.krad.uif.UifConstants;
22  import org.openqa.selenium.By;
23  import org.openqa.selenium.WebElement;
24  
25  import java.util.List;
26  
27  /**
28   * @author Kuali Rice Team (rice.collab@kuali.org)
29   */
30  public class LibraryContainersGroupBasicAft extends LibraryBase {
31  
32      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=ComponentLibraryHome";
33  
34      @Override
35      public String getBookmarkUrl() {
36          return BOOKMARK_URL;
37      }
38  
39      @Override
40      protected void navigate() throws Exception {
41          waitAndClickLibraryLink();
42      }
43  
44      protected void navigationMenu() throws Exception {
45          waitAndClickByLinkText("Containers");
46          waitAndClickByLinkText("Group");
47      }
48  
49      @Test
50      public void testBasicGroupNav() throws Exception {
51          testBasicGroupBookmark();
52      }
53  
54      /**
55       * Asserts basic group elements are present: header, validation messages,
56       * instructional text, and the actual items
57       *
58       * @throws Exception
59       */
60      @Test
61      public void testBasicGroupBookmark() throws Exception {
62          navigationMenu();
63          waitForElementPresentByXpath("//div[@id='Demo-Group-Example1']/div/h3");
64          waitForElementPresentByXpath("//div[@id='Demo-Group-Example1']/span[@class='uif-instructionalMessage']");
65          assertElementPresentByXpath("//input[@name='inputField1']");
66          assertElementPresentByXpath("//input[@name='inputField2']");
67          passed();
68      }
69  }