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 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 PermissionAftBase extends AdminTmplMthdAftNavCreateNewBase {
24  
25      protected void createNewEnterDetails() throws InterruptedException {
26          waitAndTypeByName("document.documentHeader.documentDescription",RandomStringUtils.randomAlphabetic(30));
27          selectByName("document.newMaintainableObject.templateId","KR-IDM : Assign Role");
28          selectByName("document.newMaintainableObject.namespaceCode","KR-BUS - Service Bus");
29          waitAndTypeByName("document.newMaintainableObject.name",RandomStringUtils.randomAlphabetic(10));
30      }
31  
32      /**document.documentHeader.documentDescription
33       * {@inheritDoc}
34       * Component
35       * @return
36       */
37      @Override
38      protected String getLinkLocator() {
39          return "Permission";
40      }
41  
42      protected void saveAndClose() throws InterruptedException {
43          checkForDocError();
44          waitAndClickByXpath(SAVE_XPATH);
45          waitForTextPresent("Document was successfully saved");
46          waitAndClickByName("methodToCall.close");
47  //         waitAndClickByName("methodToCall.processAnswer.button1");
48      }
49  
50      protected void saveAndReload() throws InterruptedException {
51          checkForDocError();
52          waitAndClickByXpath(SAVE_XPATH);
53          waitForTextPresent("Document was successfully saved");
54          waitAndClickByName("methodToCall.reload");
55  //         waitAndClickByName("methodToCall.processAnswer.button1");
56      }
57  
58      protected void submitAndClose() throws InterruptedException {
59          checkForDocError();
60          waitAndClickByName("methodToCall.route");
61          waitForTextPresent("Document was successfully submitted");
62          waitAndClickByName("methodToCall.close");
63  //         waitAndClickByName("methodToCall.processAnswer.button1");
64      }
65  
66      /**
67       * submits the doc and asserts that it was successfully submitted
68       * does not close the document
69       *
70       * @throws InterruptedException
71       */
72      protected void submit() throws InterruptedException {
73          checkForDocError();
74          waitAndClickByName("methodToCall.route");
75          waitForTextPresent("Document was successfully submitted");
76      }
77  }