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 edu.sampleu.admin;
17  
18  import org.apache.commons.lang.RandomStringUtils;
19  
20  /**
21   * @author Kuali Rice Team (rice.collab@kuali.org)
22   */
23  public abstract class ResponsibilityAftBase extends AdminTmplMthdAftNavCreateNewBase {
24  
25      protected void createNewEnterDetails() throws InterruptedException {
26          waitAndTypeByName("document.documentHeader.documentDescription",RandomStringUtils.randomAlphabetic(30));
27          String randomAlphabetic = RandomStringUtils.randomAlphabetic(10);
28          selectByName("document.newMaintainableObject.namespaceCode","KR-BUS - Service Bus");
29          waitAndTypeByName("document.newMaintainableObject.name",randomAlphabetic);
30          waitAndTypeByName("document.newMaintainableObject.documentTypeName","RoutingRuleDocument");
31          waitAndTypeByName("document.newMaintainableObject.routeNodeName",randomAlphabetic);
32          waitAndClickByName("document.newMaintainableObject.actionDetailsAtRoleMemberLevel");
33          waitAndClickByName("document.newMaintainableObject.required");
34      }
35  
36      /**document.documentHeader.documentDescription
37       * {@inheritDoc}
38       * Responsibility
39       * @return
40       */
41      @Override
42      protected String getLinkLocator() {
43          return "Responsibility";
44      }
45  
46      protected void saveAndClose() throws InterruptedException {
47          checkForDocError();
48          waitAndClickByXpath(SAVE_XPATH);
49          waitForTextPresent("Document was successfully saved");
50          waitAndClickByName("methodToCall.close");
51  //         waitAndClickByName("methodToCall.processAnswer.button1");
52      }
53  
54      protected void saveAndReload() throws InterruptedException {
55          checkForDocError();
56          waitAndClickByXpath(SAVE_XPATH);
57          waitForTextPresent("Document was successfully saved");
58          waitAndClickByName("methodToCall.reload");
59  //         waitAndClickByName("methodToCall.processAnswer.button1");
60      }
61  
62      protected void submitAndClose() throws InterruptedException {
63          checkForDocError();
64          waitAndClickByName("methodToCall.route");
65          waitForTextPresent("Document was successfully submitted");
66          waitAndClickByName("methodToCall.close");
67  //         waitAndClickByName("methodToCall.processAnswer.button1");
68      }
69  
70      /**
71       * submits the doc and asserts that it was successfully submitted
72       * does not close the document
73       *
74       * @throws InterruptedException
75       */
76      protected void submit() throws InterruptedException {
77          checkForDocError();
78          waitAndClickByName("methodToCall.route");
79          waitForTextPresent("Document was successfully submitted");
80      }
81  }