-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.robot
More file actions
86 lines (71 loc) · 1.99 KB
/
Copy pathexample.robot
File metadata and controls
86 lines (71 loc) · 1.99 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
*** Settings ***
Documentation Simple example demonstrating syntax highlighting.
Test Setup Keyword argument argument with ${VARIABLE}
Library Process
*** Variables ***
${VARIABLE} Variable value
@{LIST} List variable here
&{DICT} Key1=Value1 Key2=Value2
*** Test Cases ***
Keyword-driven example
Initialize System
Do Something
Result Should Be 42
[Teardown] Cleanup System
Data-driven example
[Template] Keyword
argument1 argument2
argument ${VARIABLE}
@{LIST}
Gherkin
Given system is initialized
When something is done
Then result should be "42"
| Pipes |
| | [Documentation] | Also pipe separated format is supported. |
| | Log | As this example demonstrates. |
*** Comments ***
This is a section of comments.
We can have many lines without any comment marker.
*** Keywords ***
Result Should Be
[Arguments] ${expected}
[Tags] whatever
${actual} = Get Value ${expected}
Should be Equal ${actual} ${expected}
Then result should be "${expected}"
Result Should Be ${expected}
System is initialized
# This is a single line comment
Initialize System
something is done
Do Something
Keyword
[Arguments] ${arg1} ${arg2} ${arg3}=${EMPTY}
IF "${arg1}" == "${arg2}"
Log Equal Arguments
ELSE IF "${arg1}" == "argument1"
Log arg1 is equal to argument1
ELSE
FOR ${idx} IN RANGE 4
IF ${idx} == 3 BREAK
Log ${\n}arg${idx+1} = ${arg${idx+1}} console=True
END
END
Initialize System
Log System initialized
Do Something
Run Keywords Log Done
... AND No Operation
Cleanup System
TRY
Log %{HOME}
EXCEPT
Log To Console \%{HOME} does not exist
ELSE
Log To Console \%{HOME} exists
END
Log System cleaned
Get Value
[Arguments] ${arg1}=42
RETURN ${arg1}