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 edu.sampleu.admin;
17  
18  /**
19   * @author Kuali Rice Team (rice.collab@kuali.org)
20   */
21  public abstract class ConfigComponentAftBase extends AdminTmplMthdAftNavCreateNewBase {
22  
23      protected void createNewEnterDetails() throws InterruptedException {
24          waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
25          selectOptionByName("document.newMaintainableObject.namespaceCode", namespaceCode);
26          jiraAwareTypeByName("document.newMaintainableObject.code", "code" + uniqueString);
27          jiraAwareTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
28      }
29  
30      /**
31       * {@inheritDoc}
32       * Component
33       * @return
34       */
35      @Override
36      protected String getLinkLocator() {
37          return "Component";
38      }
39  
40      protected void saveAndClose() throws InterruptedException {
41          checkForDocError();
42          waitAndClickByXpath(SAVE_XPATH);
43          waitForTextPresent("Document was successfully saved");
44          waitAndClickByName("methodToCall.close");
45  //         waitAndClickByName("methodToCall.processAnswer.button1");
46      }
47  
48      protected void saveAndReload() throws InterruptedException {
49          checkForDocError();
50          waitAndClickByXpath(SAVE_XPATH);
51          waitForTextPresent("Document was successfully saved");
52          waitAndClickByName("methodToCall.reload");
53  //         waitAndClickByName("methodToCall.processAnswer.button1");
54      }
55  
56      protected void submitAndClose() throws InterruptedException {
57          checkForDocError();
58          waitAndClickByName("methodToCall.route");
59          waitForTextPresent("Document was successfully submitted");
60          waitAndClickByName("methodToCall.close");
61  //         waitAndClickByName("methodToCall.processAnswer.button1");
62      }
63  
64      /**
65       * submits the doc and asserts that it was successfully submitted
66       * does not close the document
67       *
68       * @throws InterruptedException
69       */
70      protected void submit() throws InterruptedException {
71          checkForDocError();
72          waitAndClickByName("methodToCall.route");
73          waitForTextPresent("Document was successfully submitted");
74      }
75  
76      /**
77       * recalls a document.
78       * closes the page when done.
79       *
80       * @param cancel if true, performs recall and cancel. if false, performs recall to action list
81       *
82       * @throws InterruptedException
83       */
84      protected void recall(boolean cancel) throws InterruptedException {
85          waitAndClickByName("methodToCall.recall");
86          waitForTextPresent("the reason below");
87          waitAndTypeByName("reason", "Oops!");
88          if (cancel){
89              // recall and cancel
90              waitAndClickByName("methodToCall.processAnswer.button1");
91              waitForTextPresent("RECALLED");
92              waitAndClickByName("methodToCall.close");
93          } else {
94              // recall to action list
95              waitAndClickByName("methodToCall.processAnswer.button0");
96              waitForTextPresent("SAVED");
97              waitAndClickByName("methodToCall.close");
98              waitAndClickByName("methodToCall.processAnswer.button1");
99          }
100     }
101 
102 }