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.junit.Test;
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 ConfigNamespaceCreateNewAft extends AdminTmplMthdAftNavCreateNewBase {
27  
28      /**
29       * ITUtil.PORTAL+"?channelTitle=Namespace&channelUrl="+WebDriverUtils.getBaseUrlString()+
30       * "/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.namespace.NamespaceBo&docFormKey=88888888&returnLocation="+
31       * +ITUtil.PORTAL_URL+ ITUtil.HIDE_RETURN_LINK;
32       */   
33      public static final String BOOKMARK_URL = AutomatedFunctionalTestUtils.PORTAL+"?channelTitle=Namespace&channelUrl="+ WebDriverUtils
34              .getBaseUrlString()+"/kr/lookup.do?methodToCall=start&businessObjectClassName=org.kuali.rice.coreservice.impl.namespace.NamespaceBo&docFormKey=88888888&returnLocation="+
35              AutomatedFunctionalTestUtils.PORTAL_URL+ AutomatedFunctionalTestUtils.HIDE_RETURN_LINK;
36  
37      protected void createNewEnterDetails() throws InterruptedException {
38          waitAndTypeByName("document.documentHeader.documentDescription", getDescriptionUnique());
39          jiraAwareTypeByName("document.newMaintainableObject.code", "code" + uniqueString);
40          jiraAwareTypeByName("document.newMaintainableObject.name", "name" + uniqueString);
41      }
42  
43      @Override
44      protected String getBookmarkUrl() {
45          return BOOKMARK_URL;
46      }
47  
48      /**
49       * {@inheritDoc}
50       * Namespace
51       * @return
52       */
53      @Override
54      protected String getLinkLocator() {
55          return "Namespace";
56      }
57  
58      public void testConfigNamespaceCreateNewBookmark(JiraAwareFailable failable) throws Exception {
59          testConfigNamespaceCreateNew();
60          passed();
61      }
62  
63      public void testConfigNamespaceCreateNewNav(JiraAwareFailable failable) throws Exception {
64          testConfigNamespaceCreateNew();
65          passed();
66      }    
67      
68      public void testConfigNamespaceCreateNew() throws Exception {
69          selectFrameIframePortlet();
70          waitAndCreateNew();
71  //        waitAndClickByXpath(CREATE_NEW_XPATH);
72          String docId = waitForDocId();
73  
74          waitAndTypeByName("document.documentHeader.documentDescription", "Test description of Namespace create new " + AutomatedFunctionalTestUtils
75                  .createUniqueDtsPlusTwoRandomCharsNot9Digits());
76          waitAndTypeByName("document.newMaintainableObject.code", "KR-SYS3" + AutomatedFunctionalTestUtils
77                  .createUniqueDtsPlusTwoRandomChars());
78          waitAndTypeByName("document.newMaintainableObject.name","Enterprise Infrastructure 3");
79          waitAndTypeByName("document.newMaintainableObject.applicationId","RICE");
80  
81          addAdHocRecipientsPerson(new String[]{getUserName(), "A"});
82  
83  //        waitAndClickByName("methodToCall.route");
84          waitAndClickSave();
85          waitAndClickSubmit();
86          assertActionList(docId, "A", "ENROUTE");
87          assertOutbox(docId, "FINAL");
88          checkForDocError();
89  
90          assertDocSearch(docId, DOC_STATUS_FINAL);
91  
92  //        waitAndClickByName("methodToCall.close");
93  ////         waitAndClickByName("methodToCall.processAnswer.button1");
94      }
95  
96      @Test
97      public void testConfigNamespaceCreateNewBookmark() throws Exception {
98          testConfigNamespaceCreateNewBookmark(this);
99      }
100 
101     @Test
102     public void testConfigNamespaceCreateNewNav() throws Exception {
103         testConfigNamespaceCreateNewNav(this);
104     }
105 }