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