Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ddb92dc5

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

Re #8703 - Added ./robot_tests/.gitignore and changed README.md

Deleted outdated sample.robot test.

Zobrazit rozdíly:

README.md
11 11
## Testing
12 12
- `pytest` framework is used for testing
13 13
- tests are stored in the `tests` folder
14
 - can be run in PyCharm IDE (see [tutorial](https://www.jetbrains.com/help/pycharm/pytest.html)) or by calling `pytest` in the project's root directory
14
- can be run in PyCharm IDE (see [tutorial](https://www.jetbrains.com/help/pycharm/pytest.html)) or by calling `pytest` in the project's root directory
15
- Robot Framework tests are located in the `robot_tests` directory
15 16

  
16 17
## Deployment via Docker
17 18
- run `docker-compose up` in the project's root directory
robot_tests/.gitignore
1
out/*
robot_tests/sample.robot
1
*** Settings ***
2
Library   Browser
3

  
4
*** Variables ***
5
${url}  http://localhost:5000
6
${common_name}  Foo Bar CA
7
${common_name_field}    xpath=//input[@id='subject_CN']
8
${created_certificate_link}    xpath=//table//td[1]/a
9
${delete_button}    xpath=//button[contains(@class, 'certificate-control') and text()="Delete"]
10
${delete_button_modal}    xpath=//div[@id="deleteModal"]//button[text()="Delete"]
11
${table_rows}   xpath=//div[@id="certificateListingPage"]//table/tbody/tr
12

  
13

  
14
*** Test Cases ***
15
Example Test
16
    Setup Homepage
17
    Page Title Is    Certificate Listing
18
    Certificate Table Is Empty
19
    Click   "Create certificate"
20
    Page Title Is    Create Certificate
21
    Fill Common Name Field    ${common_name}
22
    Click   "Create certificate"
23
    Page Title Is    Certificate Listing
24
    Certificate Table Has Number Of Entries     1
25
    First Certificate Table Entry Common Name Is     ${common_name}
26
    Click First Certificate Table Entry
27
    Click Delete Button
28
    Confirm Delete Dialog
29
    Page Title Is    Certificate Listing
30
    Certificate Table Is Empty
31

  
32

  
33
*** Keywords ***
34
Setup Homepage
35
    New Page    ${url}
36

  
37
Certificate Table Has Number Of Entries
38
    [Arguments]     ${number_of_entries}
39
    Get Element Count     ${table_rows}   ==  ${number_of_entries}
40

  
41
Certificate Table Is Empty
42
    Certificate Table Has Number Of Entries     0
43

  
44
Page Title Is
45
    [Arguments]     ${title}
46
    Get Text    h1    contains    ${title}
47

  
48
Fill Common Name Field
49
    [Arguments]     ${common_name}
50
    Fill Text   ${common_name_field}    ${common_name}
51

  
52
First Certificate Table Entry Common Name Is
53
    [Arguments]     ${common_name}
54
    Get Text    ${created_certificate_link}  ==     ${common_name}
55

  
56
Click First Certificate Table Entry
57
    Click   ${created_certificate_link}
58

  
59
Click Delete Button
60
    Click   ${delete_button}
61

  
62
Confirm Delete Dialog
63
    Click   ${delete_button_modal}
64

  

Také k dispozici: Unified diff