Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 7294a1db

Přidáno uživatelem Stanislav Král před téměř 4 roky(ů)

Re #8703 - Extended user_stories.robot with a test case that verifies the "User can manage certificates " user story

Added test case comments describing which FRs are being tested.

Zobrazit rozdíly:

robot_tests/user_stories.robot
1 1
*** Settings ***
2 2
Library   Browser
3
Suite Teardown  Teardown
3
Test Setup     Setup Homepage
4
Test Teardown  Delete Root Certificate Authority Teardown
4 5

  
5 6
*** Variables ***
6 7
${url}  http://localhost:5000
7 8
${root_ca_common_name}  Root CA
8 9
${inter_ca_common_name}  Inter CA
10
${end_cert_common_name}  Foo Certificate
9 11
${common_name_field}    xpath=//input[@id='subject_CN']
10 12
${created_certificate_link}    xpath=//table//td[1]/a
11 13
${delete_button}    xpath=//button[contains(@class, 'certificate-control') and text()="Delete"]
12 14
${delete_button_modal}    xpath=//div[@id="deleteModal"]//button[text()="Delete"]
13 15
${table_rows}   xpath=//div[@id="certificateListingPage"]//table/tbody/tr
16
${table_rows_count}   xpath=count(//div[@id="certificateListingPage"]//table/tbody/tr)
14 17
${create_cert_select}   xpath=//select[@id="CA"]
15 18
${revocation_reason_select}   xpath=//select[@id="reasonSelect"]
16 19
${revoke_button_modal}   xpath=//div[@id="revokeModal"]//button[text() = "Revoke"]
......
18 21

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

  
42 55
*** Keywords ***
43
Teardown
44
    Log    Inside teardown
56
Delete Root Certificate Authority Teardown
45 57
    Setup Homepage
46
    FOR    ${i}    IN RANGE    1
47
           Log    About teardown
48
           ${certificate_table_is_empty}   Certificate Table Is Empty
49
           Exit For Loop If    ${certificate_table_is_empty}
50
           Click First Certificate Table Entry
51
           Click Delete Button
52
           Confirm Delete Dialog
53
    END
54
    Log    Exited
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
55 64

  
56 65
Create Root Certificate Authority
57 66
    [Arguments]    ${common_name}
......
59 68
    Page Title Is    Create Certificate
60 69
    Fill Common Name Field    ${common_name}
61 70
    Click   "Create certificate"
71
    Page Title Is    Certificate Listing
62 72

  
63 73
Create Intermediate Certificate Authority
64 74
    [Arguments]    ${issuer_common_name}   ${common_name}
......
70 80
    Click   "Create certificate"
71 81
    Page Title Is    Certificate Listing
72 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

  
73 92
Open Certificate Detail
74 93
    [Arguments]     ${common_name}
75 94
    Click   xpath=//td/a[string() = "${common_name}"]
......
129 148

  
130 149
Select Revocation Reason
131 150
    [Arguments]     ${revocation_reason}
132
    Log     Revocation Reason
133
    Log     ${revocation_reason}
134 151
    Get Element     ${revocation_reason_select}
135 152
    Select Options By   ${revocation_reason_select}   Label   ${revocation_reason}
136 153

  

Také k dispozici: Unified diff