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.kim.api.location;
17  
18  import edu.sampleu.admin.AdminTmplMthdAftNavBase;
19  import org.apache.commons.lang.RandomStringUtils;
20  import org.kuali.rice.testtools.common.JiraAwareFailable;
21  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
22  import org.kuali.rice.testtools.selenium.WebDriverUtils;
23  
24  /**
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   */
27  public abstract class LocationCampusBlanketAppAftBase extends AdminTmplMthdAftNavBase {
28  
29      /**
30       * ITUtil.PORTAL + "?channelTitle=Campus&channelUrl=" 
31       * + WebDriverUtils.getBaseUrlString() + ITUtil.KNS_LOOKUP_METHOD + "org.kuali.rice.location.impl.campus.CampusBo&docFormKey=88888888&returnLocation=" +
32       * ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
33       */
34      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Campus&channelUrl="
35              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KNS_LOOKUP_METHOD +
36              "org.kuali.rice.location.impl.campus.CampusBo&docFormKey=88888888&returnLocation=" +
37              AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK ;
38  
39      @Override
40      protected String getBookmarkUrl() {
41          return BOOKMARK_URL;
42      }
43  
44      /**
45       * {@inheritDoc}
46       * Campus
47       * @return
48       */
49      @Override
50      protected String getLinkLocator() {
51          return "Campus";
52      }
53     
54      public void testLocationCampusBlanketAppBookmark(JiraAwareFailable failable) throws Exception {
55          testLocationCampusBlanketApprove();
56          passed();
57      }
58  
59      public void testLocationCampusBlanketAppNav(JiraAwareFailable failable) throws Exception {
60          testLocationCampusBlanketApprove();
61          passed();
62      }
63  
64      protected void testLocationCampusBlanketApprove() throws Exception {
65          selectFrameIframePortlet();
66          waitAndCreateNew();
67          String docId = waitForDocId();
68          String twoLetters = RandomStringUtils.randomAlphabetic(2);
69          waitAndTypeByName("document.documentHeader.documentDescription", "Validation Test Campus " + twoLetters);
70          assertBlanketApproveButtonsPresent();
71          waitAndTypeByName("document.newMaintainableObject.code", RandomStringUtils.randomAlphabetic(2));
72          waitAndTypeByName("document.newMaintainableObject.name", "Validation Test Campus" + AutomatedFunctionalTestUtils
73                  .createUniqueDtsPlusTwoRandomChars());
74          waitAndTypeByName("document.newMaintainableObject.shortName", "VTC " + twoLetters);
75          selectByName("document.newMaintainableObject.campusTypeCode", "B - BOTH");
76          blanketApproveTest(docId);
77      }
78  
79  }