-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsuite.robot
More file actions
52 lines (40 loc) · 2.23 KB
/
suite.robot
File metadata and controls
52 lines (40 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
*** Settings ***
Documentation A suite to demonstrate how to load **variables** from **Python**, **JSON** and **YAML** variable files, including nested data structures.
Variables Data/pyvars-simple.py
Variables Data/pyvars-nested.py
Variables Data/pyvars-getvariables.py ${BROWSER}
Variables Data/ymlvars-nested.yaml
Variables Data/jsonvars-nested.json
*** Variables ***
${ENV} dev
${BROWSER} chrome
*** Test Cases ***
Test Pyvars-Simple
[Documentation] How to expose simple scalar values from a Python file as suite variables.
Log Random Number = ${RANDOM_INT}
Log Current time is ${CURRENT_TIME}
Log Is it afternoon? ${AFTERNOON}.
Test Pyvars-Nested
[Documentation] How to access individual values from a nested dict loaded via a Python variable file.
Should Be Equal ${cfg}[${ENV}][url] https://dev.example.com
Should Be Equal ${cfg}[${ENV}][ssl_verify] ${FALSE}
Should Be Equal ${cfg}[${ENV}][user] dev_user
Should Be Equal ${cfg}[${ENV}][password] dev_password
Test YML-Nested
[Documentation] How to load a nested data structure from a YAML variable file — same access syntax as Python dicts.
Should Be Equal ${cfg}[${ENV}][url] https://dev.example.com
Should Be Equal ${cfg}[${ENV}][ssl_verify] ${FALSE}
Should Be Equal ${cfg}[${ENV}][user] dev_user
Should Be Equal ${cfg}[${ENV}][password] dev_password
Test JSON-Nested
[Documentation] How to load a nested data structure from a YAML variable file — same access syntax as Python dicts.
Should Be Equal ${cookbook}[pasta][name] Spaghetti Carbonara
Should Be Equal As Integers ${cookbook}[pasta][time_minutes] 20
Should Contain ${cookbook}[dessert][ingredients] mascarpone
Test Get-Variables With Argument
[Documentation] How to use a get_variables() function to return different variable sets based on an argument passed at import time.
Should Be Equal ${BROWSER} chrome
Should Be Equal ${HEADLESS} ${FALSE}
Should Be Equal ${WINDOW_WIDTH} ${1920}
Should Be Equal ${WINDOW_HEIGHT} ${1080}
Should Be Equal ${DOWNLOAD_DIRS}[0] /tmp/chrome-downloads