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 LabsInquiryAttributionDefinitionFormattingAft extends LabsInquiryBase {
24  
25      /**
26       * /kr-krad/kradsampleapp?viewId=KradInquirySample-PageR2C1
27       */
28      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradInquirySample-PageR2C1";
29  
30      @Override
31      protected String getBookmarkUrl() {
32          return BOOKMARK_URL;
33      }
34  
35      @Override
36      protected void navigate() throws Exception {
37      	navigateToInquiry("Inquiry - AttributionDefinition Formatting");
38      }
39  
40      protected void testInquiryAttributionDefinitionFormatting() throws InterruptedException {
41      	// Inquiry - AttributionDefinition Formatting
42      	waitAndClickByLinkText("Inquiry - AttributionDefinition Formatting");
43  
44          String[][] formattedLabeledText = {{"Id:", "10000"},
45                                             {"Travel Authorization Document:", "10000"},
46                                             {"Travel Company Name:", "Discount Travel"},
47                                             {"Expense Type:", "ME"},
48                                             {"Expense Description:", "Family Related"},
49                                             {"Expense Date:", "/"}, // getDateToday()
50                                             {"Expense Amount:", "1,278.97"},
51                                             {"Reimbursable:", "true"},
52                                             {"Taxable:", "true"}};
53  
54          assertLabeledTextPresent(formattedLabeledText);
55          clickCollapseAll();
56          assertLabeledTextNotPresent(formattedLabeledText);
57          clickExpandAll();
58          assertLabeledTextPresent(formattedLabeledText);
59  
60          waitAndClickButtonByText("< Back");
61          
62          //Inquiry - AttributionDefinition Formatting (Partial Attribute Masking, Additional Display Attribute Name)
63          waitAndClickByLinkText("Inquiry - AttributionDefinition Formatting (Partial Attribute Masking, Additional Display Attribute Name)");
64  
65          String[][] maskedLabeledText = {{"Id:", "1"},
66                                          {"Document Number:", "??"},
67                                          {"Principal Id:", "fred"},
68  //                                      {"Traveler Name:", ""}, skip field till a good way to handle empty strings is figured out
69  //                                      {"Traveler User ID:", ""}, skip field till a good way to handle empty strings is figured out
70                                          {"First and Last Name (additionalDisplayAttributeName example):", "Test *-* Traveler"},
71                                          {"Middle Name:", "A"},
72                                          {"Last Name:", "Traveler"},
73                                          {"Street Address Line1:", "123 Nowhere St."},
74  //                                      {"Street Address Line2:", ""}, skip field till a good way to handle empty strings is figured out
75                                          {"City Name:", "Davis"},
76                                          {"State", "CA"},
77                                          {"Zip:", "95616"},
78                                          {"Country:", "US"},
79  //                                      {"Email Address:", ""}, skip field till a good way to handle empty strings is figured out
80                                          {"Gender:", "M"},
81                                          {"Phone Number:", "(xxx)xxx-xxxx"},
82                                          {"Traveler Type Code:", "EMP"},
83                                          {"Customer Number:", "CUST"},
84                                          {"Drivers License:", "*****45678"},
85                                          {"Drivers License Exp Date:", "/"},
86                                          {"Traveler Detail Active Indicator:", "true"},
87                                          {"Non Resident Alien:", "false"},
88                                          {"Liability Insurance:", "false"}};
89  
90          assertLabeledTextPresent(maskedLabeledText);
91          clickCollapseAll();
92          assertLabeledTextNotPresent(maskedLabeledText);
93          clickExpandAll();
94          assertLabeledTextPresent(maskedLabeledText);
95      }
96  
97      @Test
98      public void testInquiryAttributionDefinitionFormattingBookmark() throws Exception {
99      	testInquiryAttributionDefinitionFormatting();
100         passed();
101     }
102 
103     @Test
104     public void testInquiryAttributionDefinitionFormattingNav() throws Exception {
105     	testInquiryAttributionDefinitionFormatting();
106         passed();
107     }
108 }