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 edu.sampleu.krad.screenelement;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  
23  /**
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class RowDetailsAft extends WebDriverLegacyITBase {
27  
28      /**
29       * /kr-krad/uicomponents?viewId=Demo-RowDetails&methodToCall=start
30       */
31      public static final String BOOKMARK_URL ="/kr-krad/uicomponents?viewId=Demo-RowDetails&methodToCall=start";
32      
33      @Override
34      protected String getBookmarkUrl() {
35          return BOOKMARK_URL;
36      }
37  
38      @Override
39      protected void navigate() throws InterruptedException {
40          waitAndClickKRAD();
41          waitAndClickByLinkText("Row Details Demo");
42          switchToWindow("Kuali :: Row Details Demo");
43      }
44      
45      private void testRowDetails() throws Exception{
46          waitForProgressLoading();
47          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section6_detLink_line0']");
48          waitForElementPresentByXpath("//input[@name='field4']");
49          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section1_detLink_line0']");
50          waitForElementPresentByXpath("//input[@name='list2[0].field4']");
51          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section2_detLink_line0']");
52          waitForElementPresentByXpath("//tr/td/div/div[@data-label='Field 3']");
53          jGrowl("Expand TableCollection inside the details itself SubCollection");
54          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section3_detLink_line0']");
55          waitForTextPresent("SubField 2");
56          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section4_detLink_line0']");
57          waitForTextPresent("SubCollection Title");
58          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section5_detLink_line0']");
59          waitForTextPresent("SubCollection");
60          waitAndClickByXpath("//a[@id='Demo-RowDetails-Section7_detLink_line0']");
61          waitForElementPresentByXpath("//table[@class='uif-lightTable']");
62      }
63      
64      @Test
65      public void testRowDetailsBookmark() throws Exception {
66          testRowDetails();
67          passed();
68      }
69  
70      @Test
71      public void testRowDetailsNav() throws Exception {
72          testRowDetails();
73          passed();
74      }
75      
76  }