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
|
|