View Javadoc
1   /**
2    * Copyright 2005-2015 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;
17  
18  import org.apache.commons.lang3.RandomStringUtils;
19  import org.junit.Test;
20  import org.kuali.rice.testtools.selenium.WebDriverLegacyITBase;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  
23  /**
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class LabsCustomRuleEventAndDocumentEventMethodInvocationAft extends WebDriverLegacyITBase {
27  
28      /**
29       * /kr-krad/ruleEvent?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount
30       */
31      public static final String BOOKMARK_URL = "/kr-krad/ruleEvent?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount";
32  
33      @Override
34      protected String getBookmarkUrl() {
35          return BOOKMARK_URL;
36      }
37  
38      @Override
39      protected void navigate() throws Exception {
40      	waitAndClickByLinkText("Custom Rule Event and Document Event Method Invocation");
41      }
42  
43      protected void testDemoCustomRuleEventAndDocumentEventMethodInvocation() throws InterruptedException {
44      	 waitAndTypeByName("document.documentHeader.documentDescription","Travel Account Maintenance New Test Document");
45           String randomCode = RandomStringUtils.randomAlphabetic(9).toUpperCase();
46           waitAndTypeByName("document.newMaintainableObject.dataObject.number",randomCode);
47           waitAndTypeByName("document.newMaintainableObject.dataObject.name","Test Account Name");
48           waitAndClickByName("document.newMaintainableObject.dataObject.accountTypeCode");
49  
50           saveSuccessfully();
51  
52  //         waitAndClickByXpath("//button[@data-dismissdialogid='ConfirmBlanketApproveDialog' and contains(text(),'OK')]");
53           waitAndClickSubmitByText();
54           waitAndClickConfirmSubmitOk();
55           failOnErrorMessageItem();
56           waitForTextPresent("Document was successfully submitted.", WebDriverUtils.configuredImplicityWait() * 2);
57      }
58      
59      @Test
60      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationBookmark() throws Exception {
61      	testDemoCustomRuleEventAndDocumentEventMethodInvocation();
62          passed();
63      }
64  
65      @Test
66      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationNav() throws Exception {
67      	testDemoCustomRuleEventAndDocumentEventMethodInvocation();
68          passed();
69      }
70      
71      @Test
72      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeCheckBookmark() throws Exception {
73      	testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChec();
74          passed();
75      }
76  
77      @Test
78      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChecNav() throws Exception {
79      	testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChec();
80          passed();
81      }
82  }