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 org.kuali.rice.krad.labs.transactional;
17  
18  import org.junit.Test;
19  import org.openqa.selenium.By;
20  import org.openqa.selenium.WebElement;
21  
22  import java.util.List;
23  
24  /**
25   * This class tests lookup and copy actions for transactional document
26   *
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public class LabsLookupTravelAuthorizationDocumentCopyActionAft extends LabsTransactionalBase {
30      public static final String BOOKMARK_URL = "/kr-krad/lookup?methodToCall=start&viewId=TravelAuthorization-LookupView";
31      public static final String COPIED_FROM_DOCUMENT_ID = "3034";
32  
33      @Override
34      protected String getBookmarkUrl() {
35          return BOOKMARK_URL;
36      }
37  
38      @Override
39      protected void navigate() throws Exception {
40          navigateToTransactional("Transactional Sample - Lookup With Copy Actions");
41      }
42  
43      @Test
44      public void testTransactionalLookupAndCopyBookmark() throws Exception {
45          testTransactionalLookupAndCopy();
46          passed();
47      }
48  
49      @Test
50      public void testTransactionalLookupAndCopyNav() throws Exception {
51          testTransactionalLookupAndCopy();
52          passed();
53      }
54  
55      public void testTransactionalLookupAndCopy() throws Exception {
56          waitAndClickButtonByExactText("Search");
57          waitForElementPresent(By.id("uLookupResults_layout"));
58          jGrowl("Click on 2nd View Link");
59          waitAndClick(By.xpath("(//a[contains(text(),'View')])[2]"));
60          waitForPageToLoad();
61          waitAndClickButtonByExactText("Copy");
62          waitForPageToLoad();
63          waitAndClickByLinkText("Notes and Attachments (1)");
64      }
65  
66      public String getCopiedFromDocumentId() {
67          return COPIED_FROM_DOCUMENT_ID;
68      }
69  }