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.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 LabsDefaultRuleEventAndBusinessRuleAft extends WebDriverLegacyITBase {
27  
28      /**
29       * /kr-krad/defaultRuleEvent?methodToCall=start&dataObjectClassName=org.kuali.rice.krad.demo.travel.dataobject.TravelAccount
30       */
31      public static final String BOOKMARK_URL = "/kr-krad/defaultRuleEvent?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("Default Rule Event and Business Rule");
41      }
42  
43      protected void testDefaultRuleEventAndBusinessRule() 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           waitAndClickSubmitByText();
53           waitAndClickConfirmSubmitOk();
54           failOnErrorMessageItem();
55           waitForTextPresent("Document was successfully submitted.", WebDriverUtils.configuredImplicityWait() * 2);
56      }
57  
58      @Test
59      public void testDefaultRuleEventAndBusinessRuleBookmark() throws Exception {
60      	testDefaultRuleEventAndBusinessRule();
61          passed();
62      }
63  
64      @Test
65      public void testDefaultRuleEventAndBusinessRuleNav() throws Exception {
66      	testDefaultRuleEventAndBusinessRule();
67          passed();
68      }
69      
70      @Test
71      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeCheckBookmark() throws Exception {
72      	testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChec();
73          passed();
74      }
75  
76      @Test
77      public void testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChecNav() throws Exception {
78      	testDemoCustomRuleEventAndDocumentEventMethodInvocationAccountTypeChec();
79          passed();
80      }
81  }