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.Ignore;
19  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
20  import org.junit.Test;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class DemoTravelAccountBulkUpdateEditAft extends WebDriverLegacyITBase {
26  
27      /**
28       * /kr-krad/maintenance?viewTypeName=MAINTENANCE&methodToCall=start&docTypeName=TravelAccountBulkUpdateMaintenanceDocument
29       */
30      public static final String BOOKMARK_URL = "/kr-krad/maintenance?viewTypeName=MAINTENANCE&methodToCall=start&docTypeName=TravelAccountBulkUpdateMaintenanceDocument";
31      
32      /**
33       * Search
34       */
35      public static final String SEARCH = "Search";
36      
37      @Override
38      public String getBookmarkUrl() {
39          return BOOKMARK_URL;
40      }
41  
42      public void navigate() throws Exception {
43          waitAndClickDemoLink();
44          waitAndClickByLinkText("Travel Account Bulk Update (Edit)");
45      }
46  
47      protected void testTravelAccountBulkUpdateEdit() throws Exception {
48         waitAndTypeByName("document.documentHeader.documentDescription","Dummy Description");
49         waitAndClickByXpath("//input[@name='document.newMaintainableObject.dataObject.updateFieldValues[accountTypeCode]' and @value='IAT']");
50         waitAndClickByXpath("//div[@data-label='Travel Account Number']/div/div/button");
51         gotoLightBox();
52         waitAndTypeLabeledInput("Travel Account Number:", "a*");
53         waitAndClickButtonByExactText(SEARCH);
54         String assertContent [] = {"a11","EAT - Expense","a12","EAT - Expense","a13","CAT - Clearing"};
55         assertTextPresent(assertContent);
56         waitAndClickByXpath("//button[contains(text(),'Close')]");
57         selectTopFrame();
58         waitAndTypeByXpath("//div[@data-label='Travel Account Number']/div/input","a11");
59         waitAndClickByXpath("//button[contains(text(),'Add')]");
60         waitAndTypeByXpath("//div[@data-label='Travel Account Number']/div/input","a13");
61         waitAndClickByXpath("//button[contains(text(),'Add')]");
62         waitAndClickByXpath("//button[contains(text(),'Submit')]");
63         waitAndClickConfirmSubmitOk();
64      }
65  
66      @Test
67      public void testTravelAccountBulkUpdateEditNav() throws Exception {
68          testTravelAccountBulkUpdateEdit();
69          passed();
70      }
71  
72      @Test
73      @Ignore("https://jira.kuali.org/browse/KULRICE-13357 AFT Failures Dialogs on CI")
74      public void testTravelAccountBulkUpdateEditBookmark() throws Exception {
75          testTravelAccountBulkUpdateEdit();
76          passed();
77      }
78  }