forked from AvengersCodeLovers/automation-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.robot
35 lines (28 loc) · 1.1 KB
/
data.robot
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
*** Settings ***
Library OperatingSystem
Library Collections
Resource system.robot
*** Keywords ***
Read Invoice Fixtures
${json_data}= Get File ${EXECDIR}/invoice-fixtures.json
${json}= evaluate json.loads('''${json_data}''') json
RETURN ${json}
Initialize Test Data
${json}= Read Invoice Fixtures
set global variable ${Invoices} ${json}
Get Dummy Invoice
[Arguments] ${invoice_name}
${invoice}= Get From Dictionary ${Invoices} ${invoice_name}
Randomize Invoice Id ${invoice}
RETURN ${invoice}
Randomize Invoice Id
[Arguments] ${invoice}
${random_number}= Generate Random Number
Update Invoice Id ${invoice} ${random_number}
Update Invoice Id
[Arguments] ${invoice} ${id}
set to dictionary ${invoice} id=${id}
Get Invoice Id
[Arguments] ${invoice}
${invoice_id}= Convert To String ${invoice["id"]}
RETURN ${invoice_id}