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 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 String[][] travelAccountLabeledText = {{"Travel Account Number:", "a14"},
44 {"Travel Account Name:", "Travel Account 14"},
45 {"Code And Description:", "CAT - Clearing"},
46 // {"Subsidized Percent:", ""}, skip field till a good way to handle empty strings is figured out
47 {"Date Created:", "/"}}; // getDateToday()
48
49 String fiscalOfficer = waitForLabeledText("Fiscal Officer User ID:");
50 String fiscalOfficerName = waitForLabeledText("Fiscal Officer Name:");
51 String[][] fiscalOfficerLabeledText = {{"Fiscal Officer User ID:", fiscalOfficer},
52 {"Fiscal Officer:", fiscalOfficer},
53 {"Fiscal Officer Name:", fiscalOfficerName}};
54
55 //Not working perfectly as it is working for other pages.
56 /*String[][] dataTable = {{"A", "Sub Account A"},
57 {"B", "Sub Account B"},
58 {"C", "Sub Account C"},
59 {"D", "Sub Account D"},
60 {"E", "Sub Account E"},
61 {"F", "Sub Account F"},
62 {"G", "Sub Account G"},
63 {"H", "Sub Account H"},
64 {"I", "Sub Account Eye"},
65 {"J", "Sub Account J"}};
66 assertDataTableContains(dataTable);*/
67
68 assertLabeledTextPresent(travelAccountLabeledText);
69 assertLabeledTextPresent(fiscalOfficerLabeledText);
70 clickCollapseAll();
71 assertLabeledTextNotPresent(travelAccountLabeledText);
72 assertLabeledTextNotPresent(fiscalOfficerLabeledText);
73 clickExpandAll();
74 assertLabeledTextPresent(travelAccountLabeledText);
75 assertLabeledTextPresent(fiscalOfficerLabeledText);
76 }
77
78 @Test
79 public void testInquiryDefaultInquirableBookmark() throws Exception {
80 testInquiryDefaultInquirable();
81 passed();
82 }
83
84 @Test
85 public void testInquiryDefaultInquirableNav() throws Exception {
86 testInquiryDefaultInquirable();
87 passed();
88 }
89 }