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.inquiries;
17  
18  import org.junit.Test;
19  
20  /**
21   * @author Kuali Rice Team (rice.collab@kuali.org)
22   */
23  public class LabsInquiryCustomLinkAft extends LabsInquiryBase {
24  
25      /**
26       * /kr-krad/kradsampleapp?viewId=KradInquirySample-PageR4C1
27       */
28      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradInquirySample-PageR4C1";
29  
30      @Override
31      protected String getBookmarkUrl() {
32          return BOOKMARK_URL;
33      }
34  
35      @Override
36      protected void navigate() throws Exception {
37      	navigateToInquiry("Inquiry Custom Link");
38      }
39  
40      protected void testInquiryCustomLink() throws InterruptedException {
41      	waitAndClickByLinkText("Link to Inquiry with a Custom Link");
42          assertElementPresentByXpath("//button[contains(text(), 'Export')]");
43  
44          // Lightbox
45          waitAndClickLinkContainingText("IAT (Click for Example)");
46          gotoLightBox();
47          String[][] lightBoxLabeledText = {{"Travel Account Number:", "a3"},
48                                            {"Travel Account Name:", "Travel Account 3"},
49                                            {"Code And Description:", "IAT - Income"},
50                                            {"Subsidized Percent:", "20"},
51  //                                          {"Date Created:", ""}, // skip Date Created till a good way to handle empty strings is figured out
52                                            {"Fiscal Officer:", "frank"},
53                                            {"Fiscal Officer User ID:", "frank"},
54                                            {"Fiscal Officer Name:", "frank, frank"}};
55          assertLabeledTextPresent(lightBoxLabeledText);
56  
57          String[][] dataTable = {{"SUB1", "Sub Account 1"},
58                                  {"SUB2", "Sub Account 2"},
59                                  {"SUB3", "Sub Account 3"}};
60          assertDataTableContains(dataTable);
61  
62          clickCollapseAll();
63          assertLabeledTextNotPresent(lightBoxLabeledText);
64  
65          clickExpandAll();
66          assertLabeledTextPresent(lightBoxLabeledText);
67  
68          waitAndClickButtonByText("Close");
69      }
70  
71      @Test
72      public void testInquiryCustomLinkBookmark() throws Exception {
73      	testInquiryCustomLink();
74          passed();
75      }
76  
77      @Test
78      public void testInquiryCustomLinkNav() throws Exception {
79      	testInquiryCustomLink();
80          passed();
81      }
82  }