View Javadoc
1   /**
2    * Copyright 2005-2016 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.account;
17  
18  import org.junit.Test;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class DemoTravelAccountMaintenanceAdHocRecipientsPersonAft extends WebDriverLegacyITBase {
25  
26      /**
27       * /kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true
28       */
29      public static final String BOOKMARK_URL = "/kr-krad/maintenance?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount&hideReturnLink=true";
30  
31      @Override
32      public String getBookmarkUrl() {
33          return BOOKMARK_URL;
34      }
35  
36      protected void navigate() throws Exception {
37          waitAndClickDemoLink();
38          waitAndClickByLinkText("Travel Account Maintenance (New)");
39      }
40  
41      protected void testTravelAccountMaintenanceAdHocRecipients() throws Exception {
42          waitAndTypeByName("document.documentHeader.documentDescription", "Travel Account Maintenance AdHoc Recipients Document");
43          waitAndTypeByName("document.newMaintainableObject.dataObject.number", "adhoc");
44          waitAndTypeByName("document.newMaintainableObject.dataObject.name", "adhoc");
45          waitAndClickByXpath("//input[@name='document.newMaintainableObject.dataObject.accountTypeCode' and @value='CAT']");
46  
47          waitAndClickByLinkText("Ad Hoc Recipients");
48  
49          waitAndTypeByName("newCollectionLines['document.adHocRoutePersons'].id", "kr");
50          jGrowl("Click Add button");
51          waitAndClickById("Uif-AdHocPersonCollection_add");
52          waitForElementPresentByXpath("//div[@data-parent=\"Uif-AdHocPersonCollection\"]/div/span[contains(text(), 'KR']"); // kr added and now displayed on the page
53  
54          saveSuccessfully();
55  
56          clearTextByName("document.adHocRoutePersons[0].id");
57          waitAndTypeByName("document.adHocRoutePersons[0].id", "1");
58          waitAndClickSaveByText();
59          waitForProgressSaving();
60          //checkForDocErrorKrad();
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  }