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.main;
17  
18  import org.apache.commons.lang.RandomStringUtils;
19  import org.kuali.rice.testtools.common.JiraAwareFailable;
20  import org.kuali.rice.testtools.selenium.AutomatedFunctionalTestUtils;
21  import org.kuali.rice.testtools.selenium.WebDriverUtils;
22  
23  /**
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class ContextLookUpAftBase extends MainTmplMthdSTNavBase{
27  
28      /**
29       * ITUtil.PORTAL + "?channelTitle=Context%20Lookup&channelUrl="
30       *   + WebDriverUtils.getBaseUrlString() + ITUtil.KRAD_LOOKUP_METHOD
31       *   + "org.kuali.rice.krms.impl.repository.ContextBo"
32       *   + ITUtil.SHOW_MAINTENANCE_LINKS
33       *   + "&returnLocation=" + ITUtil.PORTAL_URL + ITUtil.HIDE_RETURN_LINK;
34       */
35      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL + "?channelTitle=Context%20Lookup&channelUrl="
36              + WebDriverUtils.getBaseUrlString() + AutomatedFunctionalTestUtils.KRAD_LOOKUP_METHOD
37              + "org.kuali.rice.krms.impl.repository.ContextBo"
38              + AutomatedFunctionalTestUtils.SHOW_MAINTENANCE_LINKS
39              + "&returnLocation=" + AutomatedFunctionalTestUtils.PORTAL_URL + AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
40  
41      @Override
42      protected String getBookmarkUrl() {
43          return BOOKMARK_URL;
44      }
45  
46      /**
47       * {@inheritDoc}
48       * Context Lookup
49       * @return
50       */
51      @Override
52      protected String getLinkLocator() {
53          return "Context Lookup";
54      }
55  
56      public void testContextLookUpBookmark(JiraAwareFailable failable) throws Exception {
57          contextLookupAssertions();
58          passed();
59      }
60      public void testContextLookUpNav(JiraAwareFailable failable) throws Exception {
61          contextLookupAssertions();
62          passed();
63      }
64  
65      public void testContextCopy(JiraAwareFailable failable) throws Exception {
66          waitAndClickSearchByText();
67          waitAndClickLinkContainingText("copy");
68          String randomNumber = RandomStringUtils.randomAlphabetic(4);
69          waitAndTypeByName("document.newMaintainableObject.dataObject.id", "Context " + randomNumber);
70          clearTextByName("document.newMaintainableObject.dataObject.name");
71          waitAndTypeByName("document.newMaintainableObject.dataObject.name", "Context name" + randomNumber);
72          clearTextByName("document.newMaintainableObject.dataObject.description");
73          waitAndTypeByName("document.newMaintainableObject.dataObject.description", "Context desc" + randomNumber);
74          waitAndClickButtonByText("Submit");
75          waitAndClickConfirmSubmitOk();
76          waitForProgressLoading(WebDriverUtils.configuredImplicityWait() * 10);
77          waitForTextPresent("Document was successfully submitted.");
78          passed();
79      }
80  }