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 org.kuali.rice.krad.labs.kitchensink;
17  
18  import org.junit.Test;
19  
20  /**
21   * @author Kuali Rice Team (rice.collab@kuali.org)
22   */
23  
24  public class LabsOtherExamplesAft extends LabsKitchenSinkBase {
25  
26      public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView";
27      
28      @Override
29      protected String getBookmarkUrl() {
30          return BOOKMARK_URL;
31      }
32  
33  	@Override
34  	protected void navigate() throws Exception {
35  		navigateToKitchenSink("Other Examples");
36  	}
37  	
38  	@Test
39      public void testOtherExamplesBookmark() throws Exception {
40  		waitAndClickByLinkText("Other Examples");
41          testOtherExamples();
42          passed();
43      }
44  
45      @Test
46      public void testOtherExamplesNav() throws Exception {
47          testOtherExamples();
48          passed();
49      }
50      
51      protected void testOtherExamples() throws InterruptedException {
52      	//Fields created by Fetching Remotable Fields
53      	waitForElementPresentByXpath("//input[@name='remoteFieldValuesMap[remoteField1]' and @value='Apple']");
54      	assertElementPresentByXpath("//select[@name='remoteFieldValuesMap[remoteField4]']");
55      	
56      	//Collection Group Remote Fields
57      	assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout uif-hasAddLine']/tbody/tr/td[3]/div/input[@value='Apple']");
58      	assertElementPresentByXpath("//button[@id='remotableFieldsCollection_add']");
59      	
60      	//Various configuration and feature examples
61      	assertElementPresentByXpath("//input[@name='field91' and @value='Read only value']");
62      	assertElementPresentByXpath("//input[@name='uiTestObject.field3' and @value='Foo-Bear']");
63      	
64      	//Tooltip examples
65      	fireEvent("field1","focus");
66      	waitForTextPresent("This tooltip is triggered by focus or and mouse over.");
67      	fireMouseOverEventByName("field2");
68      	assertElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']");
69      	fireMouseOverEventByName("field119");
70      	assertElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']");
71      	fireMouseOverEventByName("field120");
72      	assertElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']");
73      	
74      	//Collection with tooltips
75      	fireMouseOverEventByXpath("//div[@id='TableCollection1-Hover1_line1']");
76      	assertElementPresentByXpath("//td[@class='jquerybubblepopup-innerHtml']");
77      }
78  }