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
*[Defining a test run ID](#defining-a-test-run-id)
20
22
*[Upload test reports to an AWS S3 bucket](#upload-test-reports-to-an-aws-s3-bucket)
21
23
*[Testing this project](#testing-this-project)
@@ -74,10 +76,12 @@ As stated by [the official GitHub project](https://github.com/robotframework/Sel
74
76
75
77
This container can be run using the following command:
76
78
77
-
docker run \
78
-
-v <local path to the reports' folder>:/opt/robotframework/reports:Z \
79
-
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
80
-
ppodgorsek/robot-framework:<version>
79
+
```sh
80
+
docker run \
81
+
-v <local path to the reports' folder>:/opt/robotframework/reports:Z \
82
+
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
83
+
ppodgorsek/robot-framework:<version>
84
+
```
81
85
82
86
<aname="switching-browsers"></a>
83
87
@@ -114,9 +118,11 @@ It is possible to use different directories to read tests from and to generate r
114
118
115
119
It is possible to parallelise the execution of your test suites. Simply define the `ROBOT_THREADS` environment variable, for example:
116
120
117
-
docker run \
118
-
-e ROBOT_THREADS=4 \
119
-
ppodgorsek/robot-framework:latest
121
+
```sh
122
+
docker run \
123
+
-e ROBOT_THREADS=4 \
124
+
ppodgorsek/robot-framework:latest
125
+
```
120
126
121
127
By default, there is no parallelisation.
122
128
@@ -126,20 +132,24 @@ By default, there is no parallelisation.
126
132
127
133
When using parallelisation, it is possible to pass additional [pabot options](https://github.com/mkorpela/pabot#command-line-options), such as `--testlevelsplit`, `--argumentfile`, `--ordering`, etc. These can be passed by using the `PABOT_OPTIONS` environment variable, for example:
128
134
129
-
docker run \
130
-
-e ROBOT_THREADS=4 \
131
-
-e PABOT_OPTIONS="--testlevelsplit" \
132
-
ppodgorsek/robot-framework:latest
135
+
```sh
136
+
docker run \
137
+
-e ROBOT_THREADS=4 \
138
+
-e PABOT_OPTIONS="--testlevelsplit" \
139
+
ppodgorsek/robot-framework:latest
140
+
```
133
141
134
142
<aname="passing-additional-options"></a>
135
143
136
144
### Passing additional options
137
145
138
146
RobotFramework supports many options such as `--exclude`, `--variable`, `--loglevel`, etc. These can be passed by using the `ROBOT_OPTIONS` environment variable, for example:
139
147
140
-
docker run \
141
-
-e ROBOT_OPTIONS="--loglevel DEBUG" \
142
-
ppodgorsek/robot-framework:latest
148
+
```sh
149
+
docker run \
150
+
-e ROBOT_OPTIONS="--loglevel DEBUG" \
151
+
ppodgorsek/robot-framework:latest
152
+
```
143
153
144
154
<aname="testing-emails"></a>
145
155
@@ -157,9 +167,11 @@ This project is meant to allow your tests to run anywhere. Sometimes that can be
157
167
158
168
To set the timezone used inside the Docker image, you can set the `TZ` environment variable:
159
169
160
-
docker run \
161
-
-e TZ=America/New_York \
162
-
ppodgorsek/robot-framework:latest
170
+
```sh
171
+
docker run \
172
+
-e TZ=America/New_York \
173
+
ppodgorsek/robot-framework:latest
174
+
```
163
175
164
176
<aname="installing-additional-dependencies"></a>
165
177
@@ -169,10 +181,12 @@ It is possible to install additional dependencies dynamically at runtime rather
169
181
170
182
To do so, simply mount a text file containing the list of dependencies you would like to install using `pip`: (by default, this file is empty if not mounted)
171
183
172
-
docker run \
173
-
-v <local path to the dependency file>:/opt/robotframework/pip-requirements.txt:Z \
174
-
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
175
-
ppodgorsek/robot-framework:latest
184
+
```sh
185
+
docker run \
186
+
-v <local path to the dependency file>:/opt/robotframework/pip-requirements.txt:Z \
187
+
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
188
+
ppodgorsek/robot-framework:latest
189
+
```
176
190
177
191
The file must follow [Pip's official requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/).
178
192
@@ -191,9 +205,11 @@ rpa==1.50.0
191
205
192
206
By default, containers are implicitly run using `--user=1000:1000`, please remember to adjust that command-line setting accordingly, for example:
193
207
194
-
docker run \
195
-
--user=1001:1001 \
196
-
ppodgorsek/robot-framework:latest
208
+
```sh
209
+
docker run \
210
+
--user=1001:1001 \
211
+
ppodgorsek/robot-framework:latest
212
+
```
197
213
198
214
Remember that that UID/GID should be allowed to access the mounted volumes in order to read the test suites and to write the output.
199
215
@@ -208,42 +224,90 @@ This is a good security practice to make sure containers cannot perform unwanted
208
224
209
225
## Continuous integration
210
226
227
+
<aname="ci-azure-devops"></a>
228
+
229
+
### Azure DevOps pipeline
230
+
231
+
Azure DevOps provides a `Docker@2` task but it only allows a limited number of commands, it is therefore required to use a `script` instead:
@@ -257,9 +321,11 @@ For that purpose, the `ROBOT_TEST_RUN_ID` variable was introduced:
257
321
258
322
It can simply be passed during the execution, such as:
259
323
260
-
docker run \
261
-
-e ROBOT_TEST_RUN_ID="feature/branch-name" \
262
-
ppodgorsek/robot-framework:latest
324
+
```sh
325
+
docker run \
326
+
-e ROBOT_TEST_RUN_ID="feature/branch-name" \
327
+
ppodgorsek/robot-framework:latest
328
+
```
263
329
264
330
By default, the test run ID is empty.
265
331
@@ -269,48 +335,54 @@ By default, the test run ID is empty.
269
335
270
336
To upload the report of a test run to an S3 bucket, you need to define the following environment variables:
271
337
272
-
docker run \
273
-
-e AWS_ACCESS_KEY_ID=<your AWS key> \
274
-
-e AWS_SECRET_ACCESS_KEY=<your AWS secret> \
275
-
-e AWS_DEFAULT_REGION=<your AWS region e.g. eu-central-1> \
276
-
-e AWS_BUCKET_NAME=<name of your S3 bucket> \
277
-
ppodgorsek/robot-framework:latest
338
+
```sh
339
+
docker run \
340
+
-e AWS_ACCESS_KEY_ID=<your AWS key> \
341
+
-e AWS_SECRET_ACCESS_KEY=<your AWS secret> \
342
+
-e AWS_DEFAULT_REGION=<your AWS region e.g. eu-central-1> \
343
+
-e AWS_BUCKET_NAME=<name of your S3 bucket> \
344
+
ppodgorsek/robot-framework:latest
345
+
```
278
346
279
347
<a name="testing-this-project"></a>
280
348
281
349
## Testing this project
282
350
283
351
Not convinced yet? Simple tests have been prepared in the `test/` folder, you can run them using the following commands:
284
352
285
-
# Using Chromium
286
-
docker run \
287
-
-v `pwd`/reports:/opt/robotframework/reports:Z \
288
-
-v `pwd`/test:/opt/robotframework/tests:Z \
289
-
-e BROWSER=chrome \
290
-
ppodgorsek/robot-framework:latest
291
-
292
-
# Using Firefox
293
-
docker run \
294
-
-v `pwd`/reports:/opt/robotframework/reports:Z \
295
-
-v `pwd`/test:/opt/robotframework/tests:Z \
296
-
-e BROWSER=firefox \
297
-
ppodgorsek/robot-framework:latest
353
+
```sh
354
+
# Using Chromium
355
+
docker run \
356
+
-v `pwd`/reports:/opt/robotframework/reports:Z \
357
+
-v `pwd`/test:/opt/robotframework/tests:Z \
358
+
-e BROWSER=chrome \
359
+
ppodgorsek/robot-framework:latest
360
+
361
+
# Using Firefox
362
+
docker run \
363
+
-v `pwd`/reports:/opt/robotframework/reports:Z \
364
+
-v `pwd`/test:/opt/robotframework/tests:Z \
365
+
-e BROWSER=firefox \
366
+
ppodgorsek/robot-framework:latest
367
+
```
298
368
299
369
For Windows users who use **PowerShell**, the commands are slightly different:
300
370
301
-
# Using Chromium
302
-
docker run \
303
-
-v ${PWD}/reports:/opt/robotframework/reports:Z \
304
-
-v ${PWD}/test:/opt/robotframework/tests:Z \
305
-
-e BROWSER=chrome \
306
-
ppodgorsek/robot-framework:latest
307
-
308
-
# Using Firefox
309
-
docker run \
310
-
-v ${PWD}/reports:/opt/robotframework/reports:Z \
311
-
-v ${PWD}/test:/opt/robotframework/tests:Z \
312
-
-e BROWSER=firefox \
313
-
ppodgorsek/robot-framework:latest
371
+
```sh
372
+
# Using Chromium
373
+
docker run \
374
+
-v ${PWD}/reports:/opt/robotframework/reports:Z \
375
+
-v ${PWD}/test:/opt/robotframework/tests:Z \
376
+
-e BROWSER=chrome \
377
+
ppodgorsek/robot-framework:latest
378
+
379
+
# Using Firefox
380
+
docker run \
381
+
-v ${PWD}/reports:/opt/robotframework/reports:Z \
382
+
-v ${PWD}/test:/opt/robotframework/tests:Z \
383
+
-e BROWSER=firefox \
384
+
ppodgorsek/robot-framework:latest
385
+
```
314
386
315
387
Screenshots of the results will be available in the `reports/` folder.
316
388
@@ -384,11 +456,13 @@ As mentioned on the [Docker Hub](https://hub.docker.com/r/ppodgorsek/robot-frame
384
456
385
457
As mentioned in the official documentation, [Podman](https://docs.podman.io/en/latest/markdown/podman-run.1.html#platform-os-arch) and [Docker](https://docs.docker.com/build/building/multi-platform/) provide a `--platform` option which selects a given application architecture, such as:
386
458
387
-
docker run \
388
-
--platform linux/amd64 \
389
-
-v <local path to the reports' folder>:/opt/robotframework/reports:Z \
390
-
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
391
-
ppodgorsek/robot-framework:<version>
459
+
```sh
460
+
docker run \
461
+
--platform linux/amd64 \
462
+
-v <local path to the reports' folder>:/opt/robotframework/reports:Z \
463
+
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
464
+
ppodgorsek/robot-framework:<version>
465
+
```
392
466
393
467
Please note: builds and automated tests of this project will remain performed on a `linux/amd64` architecture so such emulation might not work, depending on your device and operating system.
0 commit comments