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.demo.travel.application;
17  
18  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
19  import org.junit.Test;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class DemoTravelAccountInquiryWithCollectionsAft extends WebDriverLegacyITBase {
25  
26      /**
27       * /kr-krad/inquiry?methodToCall=start&number=a14&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&viewName=original
28       */
29      public static final String BOOKMARK_URL = "/kr-krad/inquiry?methodToCall=start&number=a14&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&viewName=original";
30      
31      /**
32       * Search
33       */
34      public static final String SEARCH = "Search";
35      
36      /**
37       * Clear Values
38       */
39      public static final String CLEAR_VALUES = "Clear Values";
40      
41      @Override
42      public String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      @Override
47      protected void navigate() throws Exception {
48          waitAndClickById("Demo-DemoLink", "");
49          waitAndClickByLinkText("Travel Account Inquiry with Collections");
50      }
51  
52      protected void testTravelPerDiemLookUp() throws Exception {
53      	String travelAccountInfo []={"Travel Account Number:","a14","Travel Account Name:","Travel Account 14",
54      			"Account Type:","CAT - Clearing","Date Created:","Subsidized Percent:"," Fiscal Officer:","fran"," Fiscal Officer Name:","fran, fran"};
55      	assertTextPresent(travelAccountInfo);
56      	assertSubAccount("A","Sub Account A");
57      	assertSubAccount("B","Sub Account B");
58      	assertSubAccount("C","Sub Account C");
59      	assertSubAccount("D","Sub Account D");
60      	assertSubAccount("E","Sub Account E");
61      	assertSubAccount("F","Sub Account F");
62      	assertSubAccount("G","Sub Account G");
63      	assertSubAccount("H","Sub Account H");
64      	assertSubAccount("I","Sub Account Eye");
65      	assertSubAccount("J","Sub Account J");
66      	assertSubAccount("K","Sub Account K");
67      	assertSubAccount("L","Sub Account L");
68      	assertSubAccount("M","Sub Account M");
69      	assertSubAccount("N","Sub Account N");
70      	assertSubAccount("SUB123","Sub Account 123");
71      }
72      
73      private void assertSubAccount(String subAccountNumber,String subAccountName) throws Exception
74      {
75      	String subAccountInfo[]={"Travel Sub Account Number:",subAccountNumber,"Sub Account Name:",subAccountName};
76      	assertTextPresent(subAccountInfo);
77      }
78  
79      @Test
80      public void testTravelPerDiemLookUpBookmark() throws Exception {
81          testTravelPerDiemLookUp();
82          passed();
83      }
84  
85      @Test
86      public void testTravelPerDiemLookUpNav() throws Exception {
87          testTravelPerDiemLookUp();
88          passed();
89      }
90  }