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 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 LabsInquiryDefaultInquirableAft extends LabsInquiryBase {
24  
25      /**
26       * /kr-krad/kradsampleapp?viewId=KradInquirySample-PageR1C2
27       */
28      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradInquirySample-PageR1C2";
29  
30      @Override
31      protected String getBookmarkUrl() {
32          return BOOKMARK_URL;
33      }
34  
35      @Override
36      protected void navigate() throws Exception {
37      	navigateToInquiry("Inquiry - default inquirable");
38      }
39  
40      protected void testInquiryDefaultInquirable() throws InterruptedException {
41      	waitAndClickByLinkText("Travel Account Inquiry");
42  
43          // Lightbox
44          waitAndClickLinkContainingText("a14");
45          gotoLightBox();
46          String[][] lightBoxTravelAccountLabeledText = {{"Travel Account Number:", "a14"},
47                                            {"Travel Account Name:", "Travel Account 14"},
48                                            {"Code And Description:", "CAT - Clearing"},
49                                          //{"Subsidized Percent:", ""}, skip field till a good way to handle empty strings is figured out
50                                            };
51          String[][] lightBoxFiscalOfficerLabeledText = {{"Travel Account Number:", "a14"},
52                  {"Fiscal Officer User ID:", "fran"},
53                  {"Fiscal Officer Name:", "fran, fran"}};
54          assertLabeledTextPresent(lightBoxTravelAccountLabeledText);
55          assertLabeledTextPresent(lightBoxFiscalOfficerLabeledText);
56          
57          //Not working perfectly as it is working for other pages.
58          /*String[][] dataTable = {{"A", "Sub Account A"},
59                                  {"B", "Sub Account B"},
60                                  {"C", "Sub Account C"},
61                                  {"D", "Sub Account D"},
62                                  {"E", "Sub Account E"},
63                                  {"F", "Sub Account F"},
64                                  {"G", "Sub Account G"},
65                                  {"H", "Sub Account H"},
66                                  {"I", "Sub Account Eye"},
67                                  {"J", "Sub Account J"}};
68          assertDataTableContains(dataTable);*/
69  
70          clickCollapseAll();
71          assertLabeledTextNotPresent(lightBoxTravelAccountLabeledText);
72          assertLabeledTextNotPresent(lightBoxFiscalOfficerLabeledText);
73          clickExpandAll();
74          assertLabeledTextPresent(lightBoxTravelAccountLabeledText);
75          assertLabeledTextPresent(lightBoxFiscalOfficerLabeledText);
76          waitAndClickButtonByText(CLOSE);
77          selectTopFrame();
78          assertLabeledTextPresent(lightBoxTravelAccountLabeledText);
79          assertLabeledTextPresent(lightBoxFiscalOfficerLabeledText);
80          clickCollapseAll();
81          assertLabeledTextNotPresent(lightBoxTravelAccountLabeledText);
82          assertLabeledTextNotPresent(lightBoxFiscalOfficerLabeledText);
83          clickExpandAll();
84          assertLabeledTextPresent(lightBoxTravelAccountLabeledText);
85          assertLabeledTextPresent(lightBoxFiscalOfficerLabeledText);
86      }
87  
88      @Test
89      public void testInquiryDefaultInquirableBookmark() throws Exception {
90      	testInquiryDefaultInquirable();
91          passed();
92      }
93  
94      @Test
95      public void testInquiryDefaultInquirableNav() throws Exception {
96      	testInquiryDefaultInquirable();
97          passed();
98      }
99  }