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.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
19  import org.kuali.rice.testtools.selenium.WebDriverUtils;
20  import org.openqa.selenium.By;
21  
22  /**
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   */
25  public class ConfigParameterAft extends AdminTmplMthdAftNavCopyBase {
26  
27      /**
28       * ITUtil.PORTAL+"?channelTitle=Parameter&channelUrl="+WebDriverUtils.getBaseUrlString()+
29       * "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation="
30       * +ITUtil.PORTAL_URL+ ITUtil.HIDE_RETURN_LINK;
31       */
32      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Parameter&channelUrl="+ WebDriverUtils
33              .getBaseUrlString()+"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.parameter.ParameterBo&docFormKey=88888888&returnLocation="
34              + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
35  
36      public static String[] inputVerifyDetails;
37  
38      @Override
39      protected String getBookmarkUrl() {
40          return BOOKMARK_URL;
41      }
42  
43      /**
44       * {@inheritDoc}
45       * Parameter
46       * @return
47       */
48      @Override
49      protected String getLinkLocator() {
50          return "Parameter";
51      }
52  
53      @Override
54      protected void createNewEnterDetails() throws InterruptedException {
55          inputDetails();
56  
57          selectOptionByName("document.newMaintainableObject.namespaceCode", inputVerifyDetails[6]);
58      }
59  
60      private void inputDetails() throws InterruptedException {
61          inputVerifyDetails = new String[] {
62                  getDescriptionUnique(),
63                  "ActionList",
64                  "name" + uniqueString,
65                  "desc" + uniqueString,
66                  "Config",
67                  "Allowed",
68                  namespaceCode
69          };
70  
71  // can we generalize to figure out the input type and what to do with it?
72  //        for (String[] input: inputVerifyDetails) {
73  //            input(input[0], input[1]);
74  //        }
75  
76          waitAndTypeByName("document.documentHeader.documentDescription", inputVerifyDetails[0]);
77          jiraAwareTypeByName("document.newMaintainableObject.componentCode", inputVerifyDetails[1]);
78          jiraAwareTypeByName("document.newMaintainableObject.name", inputVerifyDetails[2]);
79          jiraAwareTypeByName("document.newMaintainableObject.description", inputVerifyDetails[3]);
80          jiraAwareTypeByName(("document.newMaintainableObject.parameterTypeCode"), inputVerifyDetails[4]);
81  //        selectOptionText(By.name("document.newMaintainableObject.parameterTypeCode"), inputVerifyDetails[4]);
82          waitAndClickByName("document.newMaintainableObject.evaluationOperatorCode", inputVerifyDetails[5]);
83      }
84  
85      @Override
86      protected void blanketApproveAssert(String docId) throws InterruptedException {
87          super.blanketApproveAssert(docId);
88          waitAndClickLinkContainingText(docId);
89  
90          driver.switchTo().window((String)driver.getWindowHandles().toArray()[1]);
91  
92          assertTextPresent(inputVerifyDetails);
93          screenshot();
94      }
95  
96      @Override
97      protected void createNewLookupDetails() throws InterruptedException {
98          inputDetails();
99  
100         assertEquals("", getTextByName(CANCEL_NAME));
101 
102         String componentLookUp = "//input[@name='methodToCall.performLookup.(!!org.kuali.rice.coreservice.impl.component.ComponentBo!!).(((code:document.newMaintainableObject.componentCode,namespaceCode:document.newMaintainableObject.namespaceCode,))).((`document.newMaintainableObject.componentCode:code,document.newMaintainableObject.namespaceCode:namespaceCode,`)).((<>)).(([])).((**)).((^^)).((&&)).((//)).((~~)).(::::;"
103                 + getBaseUrlString() + "/kr/lookup.do;::::).anchor4']";
104         waitAndClickByXpath(componentLookUp);
105         waitAndClickSearch();
106         waitAndClickReturnValue();
107     }
108 }