1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.labs.inquiries;
17
18 import org.junit.Test;
19
20
21
22
23 public class LabsInquiryAuthorizerAndComponentSecurityAft extends LabsInquiryBase {
24
25
26
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
42 waitAndClickByLinkText("Link to Inquiry with Authorizer configured");
43
44 String[][] nonSecureLabeledText = {{"Id:", "10000"},
45 {"Primary Destination:", "10000"},
46 {"Date of Use:", "/"}};
47
48 assertLabeledTextPresent(nonSecureLabeledText);
49 clickCollapseAll();
50 assertLabeledTextNotPresent(nonSecureLabeledText);
51 clickExpandAll();
52 assertLabeledTextPresent(nonSecureLabeledText);
53
54 waitAndClickButtonByText("< Back");
55
56
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
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:", "/"},
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 }