You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/chapter-01/04_styles.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ While **Keyword-Driven Testing (KDT)** and **Behavior-Driven Development (BDD)**
16
16
17
17
Both styles can be mixed, even within the same test or task, but it is strongly recommended to have separate styles for separate purposes and not mix them within the same body.
18
18
One practical solution would be to define acceptance test cases that cover users' expectations in a declarative *Behavior-Driven Style*, while using keywords that are implemented in an imperative *Keyword-Driven style*.
19
-
Further system level test cases, that are not covering acceptance criteria could be written in a *Keyword-Driven style*.
19
+
Further system level :term[test cases]{term="Test Case"}, that are not covering acceptance criteria could be written in a *Keyword-Driven style*.
20
20
21
21
The approach of both styles is different in that way,
22
22
that the *Behavior-Driven Style* is a **declarative** specification,
Copy file name to clipboardExpand all lines: website/docs/chapter-02/05_keyword_interface.md
+27-25Lines changed: 27 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,14 +70,15 @@ All of them can be called positionally or by name.
70
70
71
71

72
72
73
-
This keyword has one :term[Mandatory Arguments]{tooltipMd="An **Argument** that must be set.<br/>See [Mandatory Args](chapter-03/user_keyword)"}`dictionary` which can be called positionally or by name.
73
+
This keyword has one :term[Mandatory Argument]`dictionary` which can be called positionally or by name. See [Mandatory Args](chapter-03/user_keyword).
74
74
The latter two arguments are optional and can be used depending on the style of defining keys and values the user likes most.
75
75
76
-
The argument `key_value_pairs` is a "Variable Number of Positional Arguments" and can only be set by position.
76
+
The argument `key_value_pairs` is a :term[Variable Number of Positional Arguments] and can only be set by position.
77
77
Therefore, if it shall be set, all preceding arguments must be set by position as well.
78
78
See [2.5.2.5 Variable Number of Positional Arguments](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) for more information about this kind of argument.
79
79
80
-
The argument `items` is a "Free Named Argument" and can only be set by names.
80
+
The argument `items` is a :term[Free Named Argument] and can only be set by names.
81
+
81
82
See [2.5.2.7 Free Named Arguments](chapter-02/05_keyword_interface.md#2527-free-named-arguments) for more information about this kind of argument.
82
83
83
84
@@ -92,11 +93,11 @@ See [2.5.2.7 Free Named Arguments](chapter-02/05_keyword_interface.md#2527-free-
92
93
This keyword has 2 "Mandatory Arguments" that can be called positionally or by name.
93
94
The last two arguments are optional.
94
95
95
-
The argument `groups` is a "Variable Number of Positional Arguments" and can only be set by position.
96
+
The argument `groups` is a :term[Variable Number of Positional Arguments] and can only be set by position.
96
97
Therefore, if it shall be set, all preceding arguments must be set by position as well.
97
98
See [2.5.2.5 Variable Number of Positional Arguments](chapter-02/05_keyword_interface.md#2525-variable-number-of-positional-arguments) for more information about this kind of argument.
98
99
99
-
The argument `flags` is a "Named-Only Argument" and can only be set by name.
100
+
The argument `flags` is a :term[Named-Only Argument] and can only be set by name.
100
101
See [2.5.2.6 Named-Only Arguments](chapter-02/05_keyword_interface.md#2526-named-only-arguments) for more information about this kind of argument.
101
102
102
103
@@ -118,20 +119,20 @@ The more business oriented keywords are the less arguments they typically have.
118
119
Keyword arguments can be grouped into different argument kinds.
119
120
On the one hand you can group them by their definition attributes and on the other hand by their usage kind.
120
121
121
-
The relevant distinction of usage kinds is between using **Positional Arguments**, **Named Arguments**, or **Embedded Arguments**.
122
+
The relevant distinction of usage kinds is between using :term[Positional Arguments]{term="Positional Argument"}, :term[Named Arguments]{term="Named Argument"}, or :term[Embedded Arguments]{term="Embedded Argument"}.
122
123
How to use them is described in [2.6 Writing Test|Task and Calling Keywords](chapter-02/06_writing_test.md).
123
124
124
125
Another important information is if an argument is mandatory or optional.
125
126
See the next two sections for more information about these two kinds of arguments.
126
127
127
128
Most arguments can either be set by their position or by their name.
128
-
But there are some kinds of arguments that can only be set positionally, like **Variable Number of Positional Arguments**, or only be set named, like **Named-Only Arguments**or **Free Named Arguments**.
129
+
But there are some kinds of arguments that can only be set positionally, like :term[Variable Number of Positional Arguments], or only be set named, like :term[Named-Only Arguments]{term="Named-Only Argument"}or :term[Free Named Arguments]{term="Free Named Argument"}.
129
130
130
131
The order is as follows:
131
-
1.**Positional or Named Arguments** (can be mandatory or optional)
132
-
2.**Variable Number of Positional Arguments** (optional)
133
-
3.**Named-Only Arguments** (can be mandatory or optional)
134
-
4.**Free Named Arguments** (optional)
132
+
1.:term[Positional or Named Arguments]{term="Positional or Named Argument"} (can be mandatory or optional)
133
+
2.:term[Variable Number of Positional Arguments] (optional)
134
+
3.:term[Named-Only Arguments]{term="Named-Only Argument"} (can be mandatory or optional)
135
+
4.:term[Free Named Arguments]{term="Free Named Argument"} (optional)
135
136
136
137
### 2.5.2.1 Mandatory Arguments
137
138
@@ -189,7 +190,7 @@ Arguments that have a default value can be omitted when the keyword is called, c
189
190
These arguments are listed after the mandatory arguments in the argument interface.
190
191
Default values are defined and represented in the docs by the equal sign `=` after the argument name and a value after that.
191
192
192
-
Also "Variable Number of Positional Arguments", represented with a single star (`*`) prefix, and "Free Named Arguments", represented with a double star (`**`) prefix are optional arguments.
193
+
Also :term[Variable Number of Positional Arguments], represented with a single star (`*`) prefix, and :term[Free Named Arguments]{term="Free Named Argument"}, represented with a double star (`**`) prefix are optional arguments.
193
194
194
195
E.g. the argument `msg` in the `Should Be Equal` keyword documentation has the default value `None` and `ignore_case` has the default value `False`.
195
196
@@ -233,7 +234,7 @@ Foundation Page should be Accessible
233
234
And the url should be https://robotframework.org/foundation
234
235
```
235
236
The optional prefixes `Given`, `When`, `Then`, `And` and `But` are basically ignored by Robot Framework if a keyword is found matching the rest of the name including the embedded arguments.
236
-
In the example test case some keywords are designed so that the arguments are surrounded by double quotes (`"`) for better visibility.
237
+
In the example :term[test case] some keywords are designed so that the arguments are surrounded by double quotes (`"`) for better visibility.
237
238
238
239
A mix of embedded arguments and "normal" arguments is possible to fully support BDD.
239
240
In the keyword documentation the embedded arguments are written in variable syntax with dollar-curly-braces (`${var_name}`) to indicate that they are not part of the keyword name but are arguments.
@@ -253,7 +254,7 @@ Recall how "Positional or Named Arguments" are marked in the documentation and t
253
254
::::
254
255
255
256
Except for "Positional-Only Arguments", which are not part of this syllabus,
256
-
all arguments that are positioned before "Variable Number of Positional Arguments", "Named-Only Arguments", or "Free Named Arguments" in the argument interface of a keyword are "Positional or Named Arguments".
257
+
all arguments that are positioned before :term[Variable Number of Positional Arguments], :term[Named-Only Arguments]{term="Named-Only Argument"}, or :term[Free Named Arguments]{term="Free Named Argument"}in the argument interface of a keyword are :term[Positional or Named Arguments]{term="Positional or Named Argument"}.
257
258
258
259
As their name states, they can be set either by their position or by their name, but not by both at the same time for one argument.
259
260
If an argument shall be set by its position, all preceding arguments must be set by their position as well.
@@ -275,7 +276,7 @@ Recall how "Variable Number of Positional Arguments" are marked in the documenta
275
276
276
277
::::
277
278
278
-
A special case of optional arguments that can only be set by their position are "Variable Number of Positional Arguments".
279
+
A special case of optional arguments that can only be set by their position are :term[Variable Number of Positional Arguments].
279
280
These are also referred to as `*args` or `*varargs` in Python.
280
281
Some keywords need to collect a variable amount of values into one argument, because it is not possible to define the amount of values in advance.
281
282
@@ -286,8 +287,9 @@ Depending on the number of keys and values, different amount of arguments are ne
286
287
This key_value_pairs argument is marked with a single asterisk `*` before the argument name in the keyword documentation.
287
288
288
289
When calling this keyword, the first positional argument is assigned to `dictionary`, while all subsequent positional arguments are collected into `key_value_pairs`.
289
-
Because of this behavior, no additional positional arguments can be used after these "Variable Number of Positional Arguments".
290
-
As a result, any arguments following these "Variable Number of Positional Arguments" must be named arguments,
290
+
Because of this behavior, no additional positional arguments can be used after these :term[Variable Number of Positional Arguments].
291
+
As a result, any arguments following these :term[Variable Number of Positional Arguments] must be named arguments,
292
+
291
293
regardless of whether they are mandatory or optional arguments with a default value.
292
294
293
295
Example adding items to a dictionary using the `key_value_pairs` argument:
@@ -313,30 +315,30 @@ Recall what properties "Named-Only Arguments" have and how they are documented.
313
315
314
316
::::
315
317
316
-
All arguments that are defined after a "Variable Number of Positional Arguments" (`*varargs`) are "Named-Only Arguments".
317
-
However it is also possible to create "Named-Only Argumentswithout a preceding "Variable Number of Positional Arguments".
318
+
All arguments that are defined after a :term[Variable Number of Positional Arguments] (`*varargs`) are :term[Named-Only Arguments]{term="Named-Only Argument"}.
319
+
However it is also possible to create :term[Named-Only Arguments]{term="Named-Only Argument"}without a preceding :term[Variable Number of Positional Arguments].
318
320
319
-
"Named-Only Arguments" are marked with a "LABEL" sign `🏷` before the argument name in the keyword documentation.
321
+
:term[Named-Only Arguments]{term="Named-Only Argument"} are marked with a "LABEL" sign `🏷` before the argument name in the keyword documentation.
320
322
321
-
Those arguments can not be set positionally. All positional values would be consumed by the "Variable Number of Positional Arguments".
323
+
Those arguments can not be set positionally. All positional values would be consumed by the :term[Variable Number of Positional Arguments].
322
324
So they must be called by their name followed by an equal sign `=` and the value of the argument.
323
325
324
-
"Named-Only Arguments" can be mandatory or optional with a default value.
326
+
:term[Named-Only Arguments]{term="Named-Only Argument"} can be mandatory or optional with a default value.
325
327
326
328
### 2.5.2.7 Free Named Arguments
327
329
328
330
::::lo[Learning Objectives]
329
331
330
332
:::K1[LO-2.5.2.7]
331
333
332
-
Recall how free named arguments are marked in documentation.
334
+
Recall how "Free Named Arguments" are marked in documentation.
333
335
334
336
:::
335
337
336
338
::::
337
339
338
-
Another special case of "Named-Only Arguments" are "Free Named Arguments."
339
-
These arguments are similar to the "Variable Number of Positional Arguments" in that they can collect multiple values.
340
+
Another special case of :term[Named-Only Arguments]{term="Named-Only Argument"}are :term[Free Named Arguments]{term="Free Named Argument"}.
341
+
These arguments are similar to the :term[Variable Number of Positional Arguments] in that they can collect multiple values.
340
342
However, instead of collecting positional values, they gather all named values that are not explicitly defined as argument names.
341
343
In this case all values given to the keyword as arguments, that do contain an unescaped equal sign (`=`) are considered as named arguments.
0 commit comments