Skip to content

Commit 40daee8

Browse files
authored
Merge pull request #475 from ppodgorsek/issue-474
Issue #474 - README TOC links don't work on the Docker Hub
2 parents 0f78b7d + 983728e commit 40daee8

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@
2929

3030
-----
3131

32+
<a name="what-is-it"></a>
33+
3234
## What is it?
3335

3436
This project consists of a Docker image containing a Robot Framework installation.
3537

3638
This installation also contains Firefox, Chrome, Microsoft Edge and the Selenium library for Robot Framework. The test cases and reports should be mounted as volumes.
3739

40+
<a name="versioning"></a>
41+
3842
## Versioning
3943

4044
The versioning of this image follows the one of Robot Framework:
@@ -64,6 +68,8 @@ The versions used are:
6468

6569
As stated by [the official GitHub project](https://github.com/robotframework/Selenium2Library), starting from version 3.0, Selenium2Library is renamed to SeleniumLibrary and this project exists mainly to help with transitioning. The Selenium2Library 3.0.0 is also the last release and for new releases, please look at the [SeleniumLibrary](https://github.com/robotframework/SeleniumLibrary) project.
6670

71+
<a name="running-the-container"></a>
72+
6773
## Running the container
6874

6975
This container can be run using the following command:
@@ -73,6 +79,8 @@ This container can be run using the following command:
7379
-v <local path to the test suites' folder>:/opt/robotframework/tests:Z \
7480
ppodgorsek/robot-framework:<version>
7581

82+
<a name="switching-browsers"></a>
83+
7684
### Switching browsers
7785

7886
Browsers can be easily switched. It is recommended to define `${BROWSER} %{BROWSER}` in your Robot variables and to use `${BROWSER}` in your test cases. This allows to set the browser in a single place if needed.
@@ -81,6 +89,8 @@ When running your tests, simply add `-e BROWSER=chrome`, `-e BROWSER=firefox` or
8189

8290
Please note: `edge` will work with Selenium but not the Browser Library, as the latter currently doesn't have an easy mechanism to install additional browsers. Playwright, on which the Browser library relies, cannot install additional browsers on Linux platforms other than Ubuntu/Debian and [suggests using Chromium to test Microsoft Edge scenarios](https://playwright.dev/docs/browsers), unless you require Edge-specific capabilities.
8391

92+
<a name="changing-the-containers-screen-resolution"></a>
93+
8494
### Changing the container's screen resolution
8595

8696
It is possible to define the settings of the virtual screen in which the browser is run by changing several environment variables:
@@ -89,13 +99,17 @@ It is possible to define the settings of the virtual screen in which the browser
8999
* `SCREEN_HEIGHT` (default: 1080)
90100
* `SCREEN_WIDTH` (default: 1920)
91101

102+
<a name="changing-the-containers-tests-and-reports-directories"></a>
103+
92104
### Changing the container's tests and reports directories
93105

94106
It is possible to use different directories to read tests from and to generate reports to. This is useful when using a complex test file structure. To change the defaults, set the following environment variables:
95107

96108
* `ROBOT_REPORTS_DIR` (default: /opt/robotframework/reports)
97109
* `ROBOT_TESTS_DIR` (default: /opt/robotframework/tests)
98110

111+
<a name="parallelisation"></a>
112+
99113
### Parallelisation
100114

101115
It is possible to parallelise the execution of your test suites. Simply define the `ROBOT_THREADS` environment variable, for example:
@@ -106,6 +120,8 @@ It is possible to parallelise the execution of your test suites. Simply define t
106120

107121
By default, there is no parallelisation.
108122

123+
<a name="parallelisation-options"></a>
124+
109125
#### Parallelisation options
110126

111127
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:
@@ -115,6 +131,8 @@ When using parallelisation, it is possible to pass additional [pabot options](ht
115131
-e PABOT_OPTIONS="--testlevelsplit" \
116132
ppodgorsek/robot-framework:latest
117133

134+
<a name="passing-additional-options"></a>
135+
118136
### Passing additional options
119137

120138
RobotFramework supports many options such as `--exclude`, `--variable`, `--loglevel`, etc. These can be passed by using the `ROBOT_OPTIONS` environment variable, for example:
@@ -123,12 +141,16 @@ RobotFramework supports many options such as `--exclude`, `--variable`, `--logle
123141
-e ROBOT_OPTIONS="--loglevel DEBUG" \
124142
ppodgorsek/robot-framework:latest
125143

144+
<a name="testing-emails"></a>
145+
126146
### Testing emails
127147

128148
This project includes the IMAP library which allows Robot Framework to connect to email servers.
129149

130150
A suggestion to automate email testing is to run a [Mailcatcher instance in Docker which allows IMAP connections](https://github.com/estelora/docker-mailcatcher-imap). This will ensure emails are discarded once the tests have been run.
131151

152+
<a name="dealing-with-datetimes-and-timezones"></a>
153+
132154
### Dealing with Datetimes and Timezones
133155

134156
This project is meant to allow your tests to run anywhere. Sometimes that can be in a different timezone than your local one or of the location under test. To help solve such issues, this image includes the [DateTimeTZ Library](https://testautomation.github.io/DateTimeTZ/doc/DateTimeTZ.html).
@@ -139,6 +161,8 @@ To set the timezone used inside the Docker image, you can set the `TZ` environme
139161
-e TZ=America/New_York \
140162
ppodgorsek/robot-framework:latest
141163

164+
<a name="installing-additional-dependencies"></a>
165+
142166
### Installing additional dependencies
143167

144168
It is possible to install additional dependencies dynamically at runtime rather than having to extend this image.
@@ -161,6 +185,8 @@ rpa==1.50.0
161185

162186
**For large dependencies, it is still recommended to extend the project's image and to add them there, to avoid delaying the CI/CD pipelines with repeated dependency installations.**
163187

188+
<a name="security-considerations"></a>
189+
164190
## Security consideration
165191

166192
By default, containers are implicitly run using `--user=1000:1000`, please remember to adjust that command-line setting accordingly, for example:
@@ -178,6 +204,8 @@ Additionally, it is possible to rely on user namespaces to further secure the ex
178204

179205
This is a good security practice to make sure containers cannot perform unwanted changes on the host. In that sense, Podman is probably well ahead of Docker by not relying on a root daemon to run its containers.
180206

207+
<a name="continuous-integration"></a>
208+
181209
## Continuous integration
182210

183211
It is possible to run the project from within a Jenkins pipeline by relying on the shell command line directly:
@@ -217,6 +245,8 @@ The pipeline stage can also rely on a Docker agent, as shown in the example belo
217245
}
218246
}
219247

248+
<a name="defining-a-test-run-id"></a>
249+
220250
### Defining a test run ID
221251

222252
When relying on Continuous Integration tools, it can be useful to define a test run ID such as the build number or branch name to avoid overwriting consecutive execution reports.
@@ -233,6 +263,8 @@ It can simply be passed during the execution, such as:
233263

234264
By default, the test run ID is empty.
235265

266+
<a name="upload-test-reports-to-an-aws-s3-bucket"></a>
267+
236268
### Upload test reports to an AWS S3 bucket
237269

238270
To upload the report of a test run to an S3 bucket, you need to define the following environment variables:
@@ -244,6 +276,8 @@ To upload the report of a test run to an S3 bucket, you need to define the follo
244276
-e AWS_BUCKET_NAME=<name of your S3 bucket> \
245277
ppodgorsek/robot-framework:latest
246278

279+
<a name="testing-this-project"></a>
280+
247281
## Testing this project
248282

249283
Not convinced yet? Simple tests have been prepared in the `test/` folder, you can run them using the following commands:
@@ -280,8 +314,12 @@ For Windows users who use **PowerShell**, the commands are slightly different:
280314

281315
Screenshots of the results will be available in the `reports/` folder.
282316

317+
<a name="troubleshooting"></a>
318+
283319
## Troubleshooting
284320

321+
<a name="chromium-is-crashing"></a>
322+
285323
### Chromium is crashing
286324

287325
Chrome drivers might crash due to the small size of `/dev/shm` in the docker container:
@@ -291,6 +329,8 @@ This is [a known bug of Chromium](https://bugs.chromium.org/p/chromium/issues/de
291329

292330
To avoid this error, please change the shm size when starting the container by adding the following parameter: `--shm-size=1g` (or any other size more suited to your tests)
293331

332+
<a name="accessing-the-logs"></a>
333+
294334
### Accessing the logs
295335

296336
In case further investigation is required, the logs can be accessed by mounting their folder. Simply add the following parameter to your `run` command:
@@ -303,6 +343,8 @@ Chromium allows to set additional environment properties, which can be useful wh
303343
* `webdriver.chrome.verboseLogging=true`: enables the verbose logging mode
304344
* `webdriver.chrome.logfile=/path/to/chromedriver.log`: sets the path to Chromium's log file
305345

346+
<a name="error-suite-contains-no-tests"></a>
347+
306348
### Error: Suite contains no tests
307349

308350
When running tests, an unexpected error sometimes occurs:
@@ -321,6 +363,8 @@ It is also important to check if Robot Framework is allowed to access the resour
321363
* The folder where the tests are located,
322364
* The test files themselves.
323365

366+
<a name="database-tests-are-failing-in-spite-of-the-databaselibrary-being-present"></a>
367+
324368
### Database tests are failing in spite of the DatabaseLibrary being present
325369

326370
As per their official project page, the [Robot Framework DatabaseLibrary](https://github.com/franz-see/Robotframework-Database-Library) contains utilities meant for Robot Framework's usage. This can allow you to query your database after an action has been made to verify the results. This is compatible with any Database API Specification 2.0 module.
@@ -331,6 +375,8 @@ It is anyway mandatory to extend the container image to install the specific dat
331375
* [Oracle](https://www.oracle.com/uk/database/technologies/appdev/python.html): `pip install py2oracle`
332376
* [PostgreSQL](http://pybrary.net/pg8000/index.html): `pip install pg8000`
333377

378+
<a name="supported-devices-and-architectures"></a>
379+
334380
### Supported devices and architectures
335381

336382
As mentioned on the [Docker Hub](https://hub.docker.com/r/ppodgorsek/robot-framework), the project has been built and uploaded as a `linux/amd64` image only. This means ARM devices such as MacBook M1/M2 and Amazon EC2 Graviton won't be able to run the image with the default configuration.
@@ -347,6 +393,8 @@ Please note: builds and automated tests of this project will remain performed on
347393

348394
If this does not solve your platform-related issues, you will have to rebuild the image for your device/platform, specifying that `--platform` option during the build and run.
349395

396+
<a name="please-contribute"></a>
397+
350398
## Please contribute!
351399

352400
Have you found an issue? Do you have an idea for an improvement? Feel free to contribute by submitting it [on the GitHub project](https://github.com/ppodgorsek/docker-robot-framework/issues).

0 commit comments

Comments
 (0)