Skip to content

Commit 99d18fe

Browse files
committed
docs: fix some formatting and spelling things
1 parent b230689 commit 99d18fe

File tree

3 files changed

+95
-601
lines changed

3 files changed

+95
-601
lines changed

Diff for: docs/02_get_started/configuration.md

+87-35
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
11
# Configuration
22

33
## Introducing the `robot.toml` file
4+
45
The `robot.toml` file offers an alternative way of setting up your project in VS Code. Usually, those settings would be done via the `settings.json` file, doing so comes though at the cost of several limitations and inconveniences. Using `robot. toml` alleviates many of those by:
5-
- providing a simpler way of defining project settings in one file
6+
7+
- providing a simpler way of defining settings for the Robot Framework project in one file
68
- creating a file that can be easily shared and uploaded to a git repository
79
- removing the need to create an argument file
810
- simplifying the command line execution
911
- allowing to define multiple, easily expandable, profiles
1012

11-
Please make sure that you have installed the **Even Better TOML** extension before attempting to work with `robot.toml`.
13+
::: info
14+
The following documentation serves as a quick introduction on how to use the `robot.toml` file and will not cover all *Robot Framework* command line options. For a complete documentation of these options, please refer to the [Robot Framework User Guide](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html "Robot Framework User Guide").
15+
:::
16+
17+
::: tip
18+
If you want to have code completion and such things for TOML files, install the **[Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)** extension before attempting to work with `robot.toml`.
19+
:::
1220

13-
The following documentation serves as a quick introduction on how to use the `robot.toml` file and will cover only the essentials. For a complete documentation, please refer to the [Robot Framework User Guide](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html "Robot Framework User Guide").
1421

1522
## Settings configuration
23+
1624
Using the `robot.toml` file, we can configure a wide range of settings for our project. The example below shows how we can setup the output directory, language and global project variables. In toml, `[variables]` is a tabular setting, meaning it can store multiple name-value pairs.
25+
1726
```toml
1827
output-dir = "output"
1928
languages = ["english"]
@@ -23,12 +32,19 @@ NAME = "Tim"
2332
AGE = "25"
2433
MAIL = "hotmail.de"
2534
```
35+
2636
You can access a full list of available setting by excetuting `robot --help` in the CLI.
2737

38+
2839
## Profiles
40+
2941
Profiles allow you to store multiple configurations, in an easily accessible way. This can be useful if for example you need a different set of configurations, for testing on multiple platforms. Profiles are easily expandable and can be easily shared between developers by simply providing them the robot.toml file.
42+
43+
3044
### Defining profiles
45+
3146
You can define a profile with `[profiles.YOUR_PROFILE_NAME]`. Follow it up with the settings that you want to configure for that particular profile. For tabular settings like `[variables]` you will need to create a separate entry using `[profiles.YOUR_PROFILE_NAME.variables]`. Your profiles will use any global configuration, that has not been defined within the profile. In example below, dev2 will use English as the language and *output* as the output directory.
47+
3248
```toml
3349
output-dir = "output"
3450
languages = ["english"]
@@ -56,8 +72,11 @@ MAIL = "gmail.com"
5672
output-dir = "dev3output"
5773
```
5874

75+
5976
### Overriding and extending settings
77+
6078
Tabular settings like `[variables]` can be either overridden or expanded. In the example below, dev1 and dev2 are overriding `[variables]`. Override will prevent dev1 and dev2 from using any of the values defined in lines 4-7. This means that dev2 will not use `NAME = "Tim"` defined in line 5 but instead whatever is defined in the relevant .robot files.
79+
6180
```toml
6281
output-dir = "output"
6382
languages = ["english"]
@@ -76,7 +95,9 @@ MAIL = "web.de"
7695
AGE = "19"
7796
MAIL = "gmail.com"
7897
```
98+
7999
In order to change only selected values or add new ones, the 'extend-' prefix is needed. In the example below, dev2 will still use `NAME` and `AGE` defined in lines 2 and 3.
100+
80101
```toml
81102
[variables]
82103
NAME = "Tim"
@@ -88,8 +109,11 @@ MAIL = "gmail.com"
88109
LOCATION = "Berlin"
89110
```
90111

112+
91113
### Inheriting and merging profiles
114+
92115
Profiles can inherit from an already existing profile.
116+
93117
```toml
94118
[profiles.dev3]
95119
output-dir = "dev3output"
@@ -98,6 +122,7 @@ output-dir = "dev3output"
98122
inherits = ["dev3"]
99123
languages = ["german"]
100124
```
125+
101126
It is also possible to inherit from multiple profiles.
102127

103128
```toml
@@ -116,19 +141,31 @@ output-dir = "dev3output"
116141
[profiles.dev1and3]
117142
inherits = ["dev1, dev3"]
118143
```
119-
If a variable is present in multiple of the inherited profiles, the value of that variable will be the one, present in the last relevant inherited profile. In the example above, the value of `output-dir` for the dev1and2 profile, will be "dev3output".
144+
145+
If a variable is present in multiple of the inherited profiles, the value of that variable will be the one, present in the last relevant inherited profile. In the example above, the value of `output-dir` for the dev1and2 profile, will be "dev3output".
146+
147+
120148
### Profile management
121149

122150
#### Selecting profiles
151+
123152
You can select a profile to work with, by entering "RobotCode: Select Configuration Profiles" in the command palette (ctrl+shift+p).
153+
124154
![Select Profile1](./../images/config%20images/toml-profiles-command-selection.PNG)
155+
125156
Should you select more than one profile, a merged version of those profiles will be executed.
126157
Alternatively, you can select a profile to run or debug with, by clicking on the buttons, marked in the image below.
158+
127159
![Select Profile2](./../images/config%20images/config_selec_buttons.PNG)
160+
128161
Using this method however, does not allow you to select multiple profiles at once.
162+
163+
129164
#### Default profiles
165+
130166
It is possible to select a list of default profiles, using the `default-profiles` option. Those profiles will be selected by default, if no other profile has been selected for execution.
131167
Should you select more than one default profile, a merged version of those profiles will be executed.
168+
132169
```toml
133170
default-profiles = ["dev1", "dev2"]
134171

@@ -143,66 +180,81 @@ MAIL = "gmail.com"
143180

144181
[profiles.dev3.variables]
145182
MAIL = "hotmail.com"
183+
146184
```
185+
186+
147187
#### Hiding profiles
188+
148189
If, for whatever reason, you wish for individual profiles to not be displayed as selectable options, you can hide them by using the `hidden` option.
190+
149191
```toml
150192
[profiles.dev1]
151193
hidden = true
152194
```
195+
153196
It is also possible to hide a profile based on user defined conditions, using python expressions.
197+
154198
```toml
155199
[profiles.dev1]
156200
hidden.if = "platform.system()=='Windows'"
157201
```
202+
158203
Hidden profiles can be still merged and inherited from.
204+
205+
159206
#### Enabling profiles
207+
160208
Similar to hiding, profiles can be also disabled using the `enabled` option.
209+
161210
```toml
162211
[profiles.dev1]
163212
enabled = false
164213
```
214+
165215
It is also possible to enable or disable a profile based on user defined conditions, using python expressions.
216+
166217
```toml
167218
[profiles.dev1]
168219
enabled.if = "platform.system()=='Windows'"
169220
```
221+
170222
Disabled profiles cannot be merged or inherited from.
171223

224+
172225
### Test Execution
173-
It is possible to run tests from the CLI. TEXT ABOUT OTHER FORMS OF EXECUTION.
226+
174227
In order to execute tests using the CLI, you will need to install the `robotcode-runner` pip package and add it to your requirements.txt.
175228

229+
176230
#### Executing tests
231+
177232
Here are some of the most common ways, to execute tests via the CLI.
178233

179-
<details closed>
180-
<summary>robotcode robot PATH</summary>
181-
Executes all tests (including in subfolders) within a given location. This command can be also executed with the command <span style="color:lightblue">robotcode robot</span> robot, if you add <span style="color:lightblue">paths = "TESTFILE_LOC"</span> to your robot.toml file.
182-
</details>
183-
184-
<details closed>
185-
<summary>robotcode robot -t "TEST_CASE_NAME"<</summary>
186-
Executes the test case called <span style="color:lightblue">TEST_CASE_NAME</span>.
187-
</details>
188-
189-
<details closed>
190-
<summary>robotcode -p PROFILE_NAME robot PATH</summary>
191-
Executes all tests (including in subfolders) within a given location, with the selected profile.
192-
</details>
193-
194-
<details closed>
195-
<summary>robotcode -p PROFILE_NAME_1 -p PROFILE_NAME_2 robot PATH</summary>
196-
Executes all tests (including in subfolders) within a given location, with a merged version the selected profiles.
197-
</details>
198-
199-
<details closed>
200-
<summary>robotcode -p PROFILE_NAME -v NAME:Carl robot PATH</summary>
201-
Executes all tests (including in subfolders) within a given location. Changes the value of the variable <span style="color:lightblue">NAME</span> to <span style="color:lightblue">Carl</span>.
202-
</details>
203-
204-
<details closed>
205-
<summary>robotcode robot -i TAG_NAME</summary>
206-
Executes all tests with a given tag. Tags can be assigned either globally in the settings or individually for each test case.
207-
<IMG src="./../images/config%20images/tags_robot.PNG"/>
208-
</details>
234+
235+
- `robotcode robot PATH`
236+
237+
Executes all tests (including in subfolders) within a given location. This command can be also executed with the command `robotcode robot`, if you add `paths = "TESTFILE_LOC"` to your robot.toml file.
238+
239+
- `robotcode robot -t "TEST_CASE_NAME"`
240+
241+
Executes the test case called `TEST_CASE_NAME`
242+
243+
- `robotcode -p PROFILE_NAME robot PATH`
244+
245+
Executes all tests (including in subfolders) within a given location, with the selected profile.
246+
247+
- `robotcode -p PROFILE_NAME_1 -p PROFILE_NAME_2 robot PATH`
248+
249+
Executes all tests (including in subfolders) within a given location, with a merged version the selected profiles.
250+
251+
- `robotcode -p PROFILE_NAME -v NAME:Carl robot PATH`
252+
253+
Executes all tests (including in subfolders) within a given location. Changes the value of the variable `NAME` to `Carl`.
254+
255+
256+
- `robotcode robot -i TAG_NAME`
257+
258+
Executes all tests with a given tag. Tags can be assigned either globally in the settings or individually for each test case.
259+
260+
<IMG src="./../images/config%20images/tags_robot.PNG"/>

Diff for: docs/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"devDependencies": {
1111
"markdown-it-mathjax3": "^4.3.2",
1212
"markdown-it-task-lists": "^2.1.1",
13-
"typescript": "^5.4.5",
14-
"typescript-eslint": "^7.13.1",
15-
"vitepress": "^1.2.3",
13+
"typescript": "^5.5.4",
14+
"typescript-eslint": "^8.0.1",
15+
"vitepress": "^1.3.2",
1616
"vitepress-plugin-tabs": "^0.5.0",
17-
"vitepress-sidebar": "^1.23.2"
17+
"vitepress-sidebar": "^1.24.1"
1818
},
1919
"dependencies": {
2020
"docs": "file:"

0 commit comments

Comments
 (0)