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 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 LabsCollectionsAft extends LabsKitchenSinkBase {
25  
26      public static final String BOOKMARK_URL = "/kr-krad/uicomponents?viewId=UifCompView&formKey=ab7fa92d-a2a0-4b94-b349-c00eb81de311&cacheKey=endwmf7mxaohx3lxynk6sm&pageId=UifCompView-Page7#UifCompView-Page7";
27  
28      @Override
29      protected String getBookmarkUrl() {
30          return BOOKMARK_URL;
31      }
32  
33  	@Override
34  	protected void navigate() throws Exception {
35  		navigateToKitchenSink("Collections");
36  	}
37  	
38  	@Test
39      public void testCollectionsBookmark() throws Exception {
40          testCollections();
41          passed();
42      }
43  
44      @Test
45      public void testCollectionsNav() throws Exception {
46          testCollections();
47          passed();
48      }
49      
50      protected void testCollections() throws InterruptedException 
51      {
52      	//Collection Group 1 - CollectionGroupTableLayout
53      	assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout uif-hasAddLine']/tbody/tr[@class='uif-collectionAddItem']");
54      	assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout uif-hasAddLine']/tbody/tr/td[@class='uif-collection-column-action uif-collection-column-action']");
55      
56      	//Collection Group 2 - CollectionGroupTableLayout with jQuery table features on
57      	assertElementPresentByXpath("//table[@class='table table-condensed table-bordered uif-tableCollectionLayout uif-hasAddLine dataTable']/tbody/tr[@class='uif-collectionAddItem odd']");
58      	assertElementPresentByXpath("//div[@class='dataTables_length']/label/select");
59      	
60      	//Collection Group 6 - CollectionGroupTableLayout with jQuery table features on
61      	assertElementPresentByXpath("//div[@class='uif-collectionItem uif-tableCollectionItem uif-collectionAddItem']/table[@class='table table-condensed table-bordered uif-gridLayout']");
62      	assertElementPresentByXpath("//div[@class='dataTables_scrollBody']/table[@class='table table-condensed table-bordered uif-tableCollectionLayout dataTable']/tbody/tr/td[@class='uif-collection-column-action uif-collection-column-action ']");
63      	
64      	//Collection Group 3 - Stacked
65      	assertElementPresentByXpath("//div[@id='collection3_disclosureContent']/div[@class='uif-stackedCollectionLayout']/div/table");
66      	
67      	//Collection Group 4 - Stacked Collection with a Table subcollection
68      	assertElementPresentByXpath("//div[@id='collection4_disclosureContent']/div[@class='uif-stackedCollectionLayout']/div/table");
69      	waitAndClickByXpath("//span[contains(text(),'SubCollection - (3 lines)')]");
70      	assertElementPresentByXpath("//div[@id='subCollection1_line0_disclosureContent']");
71      	
72      	//Collection Group 5 - Stacked Collection with a Stacked subcollection
73      	assertElementPresentByXpath("//ul/li/div[@data-parent='UifCompView-CollectionList']");
74      }
75  }