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.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
19  import org.kuali.rice.testtools.selenium.WebDriverUtils;
20  
21  /**
22   * @author Kuali Rice Team (rice.collab@kuali.org)
23   */
24  public class WorkFlowDocTypeAft extends AdminTmplMthdAftNavBlanketAppBase {
25  
26      /**
27       * ITUtil.PORTAL + "?channelTitle=Document%20Type&channelUrl=" 
28       * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.kew.doctype.bo.DocumentType&returnLocation=" +
29       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK + ITUtil.DOC_FORM_KEY+ "88888888";
30       */
31      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Document%20Type&channelUrl="
32              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
33              "org.kuali.rice.kew.doctype.bo.DocumentType&returnLocation=" +
34              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK + AutomatedFunctionalTestUtils.DOC_FORM_KEY+ "88888888";
35  
36      @Override
37      protected String getBookmarkUrl() {
38          return BOOKMARK_URL;
39      }
40  
41      /**
42       * {@inheritDoc}
43       * Document Type
44       * @return
45       */
46      @Override
47      protected String getLinkLocator() {
48          return "Document Type";
49      }
50  
51      @Override
52      protected void createNewEnterDetails() throws InterruptedException {
53          inputDetails();
54      }
55  
56      private void inputDetails() throws InterruptedException {
57          waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
58          jiraAwareTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
59          waitAndTypeByName("document.newMaintainableObject.unresolvedHelpDefinitionUrl",
60                  "${kr.url}/maintenance.do?methodToCall=docHandler"); // optional
61          jiraAwareTypeByName("document.newMaintainableObject.label", "label" + uniqueString);
62          jiraAwareTypeByName("document.newMaintainableObject.unresolvedHelpDefinitionUrl",
63                  "default.htm?turl=WordDocuments%2Fdocumenttype.htm"); // optional
64      }
65  
66      @Override
67      protected void createNewLookupDetails() throws InterruptedException {
68          inputDetails();
69  
70          String parentDocType = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.kew.doctype.bo.DocumentType!!).(((name:document.newMaintainableObject.parentDocType.name,documentTypeId:document.newMaintainableObject.docTypeParentId,))).((`document.newMaintainableObject.parentDocType.name:name,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
71                  + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
72          waitAndClickByXpath(parentDocType);
73          waitAndClickSearch();
74          waitAndClickReturnValue();
75      }
76  }