Projekt

Obecné

Profil

Stáhnout (6.55 KB) Statistiky
| Větev: | Tag: | Revize:
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
${no_certificate_found}  No certificate found
12
${common_name_field}    xpath=//input[@id='subject_CN']
13
${created_certificate_link}    xpath=//table//td[1]/a
14
${delete_button}    xpath=//button[contains(@class, 'certificate-control') and text()="Delete"]
15
${delete_button_modal}    xpath=//div[@id="deleteModal"]//button[text()="Delete"]
16
${table_rows}   xpath=//div[@id="certificateListingPage"]//table/tbody/tr
17
${table_rows_count}   xpath=count(//div[@id="certificateListingPage"]//table/tbody/tr)
18
${create_cert_select}   xpath=//select[@id="CA"]
19
${revocation_reason_select}   xpath=//select[@id="reasonSelect"]
20
${revoke_button_modal}   xpath=//div[@id="revokeModal"]//button[text() = "Revoke"]
21
${certificate_status_span}   xpath=//table//td[2]/h5/span
22

    
23
*** Test Cases ***
24
User Can Manage Certificate Authorities
25
    Page Title Is    Certificate Listing                                                        # FR 1.1 - root CA
26
    Certificate Table Is Empty
27
    Create Root Certificate Authority   ${root_ca_common_name}
28
    Page Title Is    Certificate Listing
29
    Certificate Table Has Number Of Entries     1
30
    Verify Certificate Is A Certificate Authority   ${root_ca_common_name}
31
    Create Intermediate Certificate Authority   ${root_ca_common_name}  ${inter_ca_common_name}     # FR 1.1 - inter CA
32
    Certificate Table Has Number Of Entries     2
33
    Verify Certificate Is A Certificate Authority   ${inter_ca_common_name}
34
    Open Certificate Detail   ${inter_ca_common_name}                                           # FR 1.3 - validity
35
    Page Title Is    Certificate Detailed View
36
    Certificate Status Is   Valid
37
    Revoke Certificate  keyCompromise                                                           # FR 1.2 - revocation
38
    Check Certificate Is Revoked
39
    Click Delete Button                                                                         # FR 1.3 - deletion
40
    Confirm Delete Dialog
41
    Page Title Is   Certificate Listing
42
    Certificate Table Has Number Of Entries     1
43
    First Certificate Table Entry Common Name Is     ${root_ca_common_name}
44

    
45
User Can Manage Certificates
46
    Page Title Is   Certificate Listing                                                         # root CA required
47
    Certificate Table Is Empty
48
    Create Root Certificate Authority   ${root_ca_common_name}
49
    Create Certificate  ${root_ca_common_name}  ${end_cert_common_name}                         # FR 2.1
50
    Certificate Table Has Number Of Entries     2
51
    Open Certificate Detail     ${end_cert_common_name}                                         # FR 2.3
52
    Certificate Status Is   Valid
53
    Revoke Certificate  keyCompromise                                                           # FR 2.2
54
    Check Certificate Is Revoked
55

    
56
*** Keywords ***
57
Delete Root Certificate Authority Teardown
58
    Setup Homepage
59
    Wait Until Network Is Idle
60
    Page Title Is    Certificate Listing
61
    Open Certificate Detail     ${root_ca_common_name}
62
    # deleting the root CA deletes all of it's children
63
    Click Delete Button
64
    Confirm Delete Dialog
65
    Wait Until Network Is Idle
66
    Certificate Table Is Empty
67

    
68
Create Root Certificate Authority
69
    [Arguments]    ${common_name}
70
    Click   "+"
71
    Wait Until Network Is Idle
72
    Page Title Is    Create Certificate
73
    Fill Common Name Field    ${common_name}
74
    Click   "Create certificate"
75
    Wait Until Network Is Idle
76
    Page Title Is    Certificate Listing
77

    
78
Create Intermediate Certificate Authority
79
    [Arguments]    ${issuer_common_name}   ${common_name}
80
    Click   "+"
81
    Wait Until Network Is Idle
82
    Page Title Is    Create Certificate
83
    Select Issuer   ${issuer_common_name}
84
    Fill Common Name Field    ${common_name}
85
    Check Checkbox  "CA"
86
    Click   "Create certificate"
87
    Wait Until Network Is Idle
88
    Page Title Is    Certificate Listing
89

    
90
Create Certificate
91
    [Arguments]    ${issuer_common_name}   ${common_name}
92
    Click   "+"
93
    Wait Until Network Is Idle
94
    Page Title Is    Create Certificate
95
    Select Issuer   ${issuer_common_name}
96
    Fill Common Name Field    ${common_name}
97
    Click   "Create certificate"
98
    Wait Until Network Is Idle
99
    Page Title Is    Certificate Listing
100

    
101
Open Certificate Detail
102
    [Arguments]     ${common_name}
103
    Click   xpath=//td/a[string() = "${common_name}"]
104
    Wait Until Network Is Idle
105

    
106
Revoke Certificate
107
    [Arguments]  ${reason}
108
    Click Revoke Button
109
    Select Revocation Reason    ${reason}
110
    Confirm Revoke Dialog
111
    Wait Until Network Is Idle
112

    
113
Verify Certificate Is A Certificate Authority
114
    [Arguments]     ${common_name}
115
    Open Certificate Detail     ${common_name}
116
    Wait Until Network Is Idle
117
    Get Checkbox State  xpath=//input[@id="isCA"]   ==  checked
118
    Go Back
119

    
120
Setup Homepage
121
    New Page    ${url}
122

    
123
Certificate Table Has Number Of Entries
124
    [Arguments]     ${number_of_entries}
125
    Get Element Count     ${table_rows}   ==  ${number_of_entries}
126

    
127
Certificate Table Is Empty
128
    Certificate Table Has Number Of Entries  1
129
    Get Text  ${table_rows}  ==  ${no_certificate_found}
130

    
131
Page Title Is
132
    [Arguments]     ${title}
133
    Get Text    h1    contains    ${title}
134

    
135
Fill Common Name Field
136
    [Arguments]     ${common_name}
137
    Fill Text   ${common_name_field}    ${common_name}
138

    
139
First Certificate Table Entry Common Name Is
140
    [Arguments]     ${common_name}
141
    Get Text    ${created_certificate_link}  ==     ${common_name}
142

    
143
Click First Certificate Table Entry
144
    Click   ${created_certificate_link}
145

    
146
Click Delete Button
147
    Click   ${delete_button}
148

    
149
Confirm Delete Dialog
150
    Click   ${delete_button_modal}
151

    
152
Select Issuer
153
    [Arguments]     ${issuer_name}
154
    Select Options By   ${create_cert_select}   Label   ${issuer_name}
155

    
156
Click Revoke Button
157
    Click   "Revoke"
158

    
159
Confirm Revoke Dialog
160
    Click   ${revoke_button_modal}
161

    
162
Select Revocation Reason
163
    [Arguments]     ${revocation_reason}
164
    Get Element     ${revocation_reason_select}
165
    Select Options By   ${revocation_reason_select}   Label   ${revocation_reason}
166

    
167
Revocation Success Messsage Is Shown
168
    Get Element     xpath=//div[@class="alert alert-success" and contains(string(), "Certificate revocation successful.")]
169

    
170
Certificate Status Is
171
    [Arguments]     ${certificate_status}
172
    Get Text    ${certificate_status_span}  ==  ${certificate_status}
173

    
174
Check Certificate Is Revoked
175
    Revocation Success Messsage Is Shown
176
    Certificate Status Is   Revoked
177

    
(2-2/2)