1
|
*** Settings ***
|
2
|
Library Browser
|
3
|
Test Setup Setup Homepage
|
4
|
Test Teardown Delete Root Certificate Authority Teardown
|
5
|
|
6
|
*** Variables ***
|
7
|
${url} http://localhost:5000
|
8
|
${root_ca_common_name} Root CA
|
9
|
${inter_ca_common_name} Inter CA
|
10
|
${end_cert_common_name} Foo Certificate
|
11
|
${common_name_field} xpath=//input[@id='subject_CN']
|
12
|
${created_certificate_link} xpath=//table//td[1]/a
|
13
|
${delete_button} xpath=//button[contains(@class, 'certificate-control') and text()="Delete"]
|
14
|
${delete_button_modal} xpath=//div[@id="deleteModal"]//button[text()="Delete"]
|
15
|
${table_rows} xpath=//div[@id="certificateListingPage"]//table/tbody/tr
|
16
|
${table_rows_count} xpath=count(//div[@id="certificateListingPage"]//table/tbody/tr)
|
17
|
${create_cert_select} xpath=//select[@id="CA"]
|
18
|
${revocation_reason_select} xpath=//select[@id="reasonSelect"]
|
19
|
${revoke_button_modal} xpath=//div[@id="revokeModal"]//button[text() = "Revoke"]
|
20
|
${certificate_status_span} xpath=//table//td[2]/h5/span
|
21
|
|
22
|
*** Test Cases ***
|
23
|
User Can Manage Certificate Authorities
|
24
|
Page Title Is Certificate Listing # FR 1.1 - root CA
|
25
|
Certificate Table Is Empty
|
26
|
Create Root Certificate Authority ${root_ca_common_name}
|
27
|
Page Title Is Certificate Listing
|
28
|
Certificate Table Has Number Of Entries 1
|
29
|
Verify Certificate Is A Certificate Authority ${root_ca_common_name}
|
30
|
Create Intermediate Certificate Authority ${root_ca_common_name} ${inter_ca_common_name} # FR 1.1 - inter CA
|
31
|
Certificate Table Has Number Of Entries 2
|
32
|
Verify Certificate Is A Certificate Authority ${inter_ca_common_name}
|
33
|
Open Certificate Detail ${inter_ca_common_name} # FR 1.3 - validity
|
34
|
Page Title Is Certificate Detailed View
|
35
|
Certificate Status Is Valid
|
36
|
Revoke Certificate keyCompromise # FR 1.2 - revocation
|
37
|
Check Certificate Is Revoked
|
38
|
Click Delete Button # FR 1.3 - deletion
|
39
|
Confirm Delete Dialog
|
40
|
Page Title Is Certificate Listing
|
41
|
Certificate Table Has Number Of Entries 1
|
42
|
First Certificate Table Entry Common Name Is ${root_ca_common_name}
|
43
|
|
44
|
User Can Manage Certificates
|
45
|
Page Title Is Certificate Listing # root CA required
|
46
|
Certificate Table Is Empty
|
47
|
Create Root Certificate Authority ${root_ca_common_name}
|
48
|
Create Certificate ${root_ca_common_name} ${end_cert_common_name} # FR 2.1
|
49
|
Certificate Table Has Number Of Entries 2
|
50
|
Open Certificate Detail ${end_cert_common_name} # FR 2.3
|
51
|
Certificate Status Is Valid
|
52
|
Revoke Certificate keyCompromise # FR 2.2
|
53
|
Check Certificate Is Revoked
|
54
|
|
55
|
*** Keywords ***
|
56
|
Delete Root Certificate Authority Teardown
|
57
|
Setup Homepage
|
58
|
Page Title Is Certificate Listing
|
59
|
Open Certificate Detail ${root_ca_common_name}
|
60
|
# deleting the root CA deletes all of it's children
|
61
|
Click Delete Button
|
62
|
Confirm Delete Dialog
|
63
|
Certificate Table Is Empty
|
64
|
|
65
|
Create Root Certificate Authority
|
66
|
[Arguments] ${common_name}
|
67
|
Click "+"
|
68
|
Page Title Is Create Certificate
|
69
|
Fill Common Name Field ${common_name}
|
70
|
Click "Create certificate"
|
71
|
Page Title Is Certificate Listing
|
72
|
|
73
|
Create Intermediate Certificate Authority
|
74
|
[Arguments] ${issuer_common_name} ${common_name}
|
75
|
Click "+"
|
76
|
Page Title Is Create Certificate
|
77
|
Select Issuer ${issuer_common_name}
|
78
|
Fill Common Name Field ${common_name}
|
79
|
Check Checkbox "CA"
|
80
|
Click "Create certificate"
|
81
|
Page Title Is Certificate Listing
|
82
|
|
83
|
Create Certificate
|
84
|
[Arguments] ${issuer_common_name} ${common_name}
|
85
|
Click "+"
|
86
|
Page Title Is Create Certificate
|
87
|
Select Issuer ${issuer_common_name}
|
88
|
Fill Common Name Field ${common_name}
|
89
|
Click "Create certificate"
|
90
|
Page Title Is Certificate Listing
|
91
|
|
92
|
Open Certificate Detail
|
93
|
[Arguments] ${common_name}
|
94
|
Click xpath=//td/a[string() = "${common_name}"]
|
95
|
|
96
|
Revoke Certificate
|
97
|
[Arguments] ${reason}
|
98
|
Click Revoke Button
|
99
|
Select Revocation Reason ${reason}
|
100
|
Confirm Revoke Dialog
|
101
|
|
102
|
Verify Certificate Is A Certificate Authority
|
103
|
[Arguments] ${common_name}
|
104
|
Open Certificate Detail ${common_name}
|
105
|
Get Checkbox State xpath=//input[@id="isCA"] == checked
|
106
|
Go Back
|
107
|
|
108
|
Setup Homepage
|
109
|
New Page ${url}
|
110
|
|
111
|
Certificate Table Has Number Of Entries
|
112
|
[Arguments] ${number_of_entries}
|
113
|
Get Element Count ${table_rows} == ${number_of_entries}
|
114
|
|
115
|
Certificate Table Is Empty
|
116
|
Certificate Table Has Number Of Entries 0
|
117
|
|
118
|
Page Title Is
|
119
|
[Arguments] ${title}
|
120
|
Get Text h1 contains ${title}
|
121
|
|
122
|
Fill Common Name Field
|
123
|
[Arguments] ${common_name}
|
124
|
Fill Text ${common_name_field} ${common_name}
|
125
|
|
126
|
First Certificate Table Entry Common Name Is
|
127
|
[Arguments] ${common_name}
|
128
|
Get Text ${created_certificate_link} == ${common_name}
|
129
|
|
130
|
Click First Certificate Table Entry
|
131
|
Click ${created_certificate_link}
|
132
|
|
133
|
Click Delete Button
|
134
|
Click ${delete_button}
|
135
|
|
136
|
Confirm Delete Dialog
|
137
|
Click ${delete_button_modal}
|
138
|
|
139
|
Select Issuer
|
140
|
[Arguments] ${issuer_name}
|
141
|
Select Options By ${create_cert_select} Label ${issuer_name}
|
142
|
|
143
|
Click Revoke Button
|
144
|
Click "Revoke"
|
145
|
|
146
|
Confirm Revoke Dialog
|
147
|
Click ${revoke_button_modal}
|
148
|
|
149
|
Select Revocation Reason
|
150
|
[Arguments] ${revocation_reason}
|
151
|
Get Element ${revocation_reason_select}
|
152
|
Select Options By ${revocation_reason_select} Label ${revocation_reason}
|
153
|
|
154
|
Revocation Success Messsage Is Shown
|
155
|
Get Element xpath=//div[@class="alert alert-success" and contains(string(), "Certificate revocation successful.")]
|
156
|
|
157
|
Certificate Status Is
|
158
|
[Arguments] ${certificate_status}
|
159
|
Get Text ${certificate_status_span} == ${certificate_status}
|
160
|
|
161
|
Check Certificate Is Revoked
|
162
|
Revocation Success Messsage Is Shown
|
163
|
Certificate Status Is Revoked
|
164
|
|