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  
17  package org.kuali.rice.krad.demo.travel.account;
18  
19  import org.junit.Test;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoTravelAccountMaintenanceAdHocRecipientsPersonAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true";
31  
32      @Override
33      public String getBookmarkUrl() {
34          return BOOKMARK_URL;
35      }
36  
37      protected void navigate() throws Exception {
38          waitAndClickById("Demo-DemoLink", "");
39          waitAndClickByLinkText("Travel Account Maintenance (New)");
40      }
41  
42      protected void testTravelAccountMaintenanceAdHocRecipients() throws Exception {
43          waitAndTypeByName("document.documentHeader.documentDescription", "Travel Account Maintenance AdHoc Recipients Document");
44          waitAndTypeByName("document.newMaintainableObject.dataObject.number", "adhoc");
45          waitAndTypeByName("document.newMaintainableObject.dataObject.name", "adhoc");
46          waitAndClickByXpath("//input[@name='document.newMaintainableObject.dataObject.accountTypeCode' and @value='CAT']");
47  
48          waitAndClickByLinkText("Ad Hoc Recipients");
49  
50          waitAndTypeByName("newCollectionLines['document.adHocRoutePersons'].id", "kr");
51          waitAndClickById("Uif-AdHocPersonCollection_add");
52          jGrowl("Click Add button");
53          waitAndClickButtonByText("Save");
54  
55          waitForTextPresent("Document was successfully saved.");
56  
57          clearTextByName("document.adHocRoutePersons[0].id");
58          waitAndTypeByName("document.adHocRoutePersons[0].id", "1");
59          waitAndClickButtonByText("Save");
60  
61          waitForTextPresent("Invalid Ad Hoc Routing Person Network Id");
62      }
63  
64      @Test
65      public void testDemoTravelAccountMaintenanceAdHocRecipientsBookmark() throws Exception {
66          testTravelAccountMaintenanceAdHocRecipients();
67          passed();
68      }
69  
70      @Test
71      public void testDemoTravelAccountMaintenanceAdHocRecipientsNav() throws Exception {
72          testTravelAccountMaintenanceAdHocRecipients();
73          passed();
74      }
75  
76  }