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 LabsInquiryAuthorizerAndComponentSecurityAft extends LabsInquiryBase {
24  
25      /**
26       * /kr-krad/kradsampleapp?viewId=KradInquirySample-PageR3C2
27       */
28      public static final String BOOKMARK_URL = "/kr-krad/kradsampleapp?viewId=KradInquirySample-PageR3C2";
29  
30      @Override
31      protected String getBookmarkUrl() {
32          return BOOKMARK_URL;
33      }
34  
35      @Override
36      protected void navigate() throws Exception {
37      	navigateToInquiry("Inquiries with Authorizer and Component Security");
38      }
39  
40      protected void testInquiryAuthorizerAndComponentSecurity() throws InterruptedException {
41      	// Link to Inquiry with Authorizer configured
42      	waitAndClickByLinkText("Link to Inquiry with Authorizer configured");
43  
44          String[][] nonSecureLabeledText = {{"Id:", "10000"},
45                                             {"Primary Destination:", "10000"},
46                                             {"Date of Use:", "/"}}; // getDateToday()
47  
48          assertLabeledTextPresent(nonSecureLabeledText);
49          clickCollapseAll();
50          assertLabeledTextNotPresent(nonSecureLabeledText);
51          clickExpandAll();
52          assertLabeledTextPresent(nonSecureLabeledText);
53  
54          waitAndClickButtonByText("< Back");
55          
56          // Link to Inquiry with Component Security and Attribute Security configured on the view.
57          waitAndClickByLinkText("Link to Inquiry with Component Security and Attribute Security configured on the view.");
58  
59          assertLabeledTextPresent(nonSecureLabeledText);
60          clickCollapseAll();
61          assertLabeledTextNotPresent(nonSecureLabeledText);
62          clickExpandAll();
63          assertLabeledTextPresent(nonSecureLabeledText);
64  
65          waitAndClickButtonByText("< Back");
66  
67          // Link to Inquiry with Component Security and Attribute Security overriden by Kim Permissions.
68          waitAndClickByLinkText("Link to Inquiry with Component Security and Attribute Security overriden by Kim Permissions.");
69  
70          String[][] secureLabeledText = {{"Id:", "10000"},
71                                          {"Travel Authorization Document Id:", "10000"},
72                                          {"Primary Destination:", "10000"},
73                                          {"Date of Use:", "/"}, // getDateToday()
74                                          {"Breakfast Value:", "10"},
75                                          {"Lunch Value:", "10"},
76                                          {"Dinner Value:", "15"},
77                                          {"Amount estimated for incidentals:", "20"},
78                                          {"Mileage Rate Name:", "Domestic"},
79                                          {"Mileage Rate:", "0.305"},
80                                          {"Number of estimated miles:", "30"}};
81  
82          assertLabeledTextPresent(secureLabeledText);
83          clickCollapseAll();
84          assertLabeledTextNotPresent(secureLabeledText);
85          clickExpandAll();
86          assertLabeledTextPresent(secureLabeledText);
87      }
88  
89      @Test
90      public void testInquiryAuthorizerAndComponentSecurityBookmark() throws Exception {
91      	testInquiryAuthorizerAndComponentSecurity();
92          passed();
93      }
94  
95      @Test
96      public void testInquiryAuthorizerAndComponentSecurityNav() throws Exception {
97      	testInquiryAuthorizerAndComponentSecurity();
98          passed();
99      }
100 }