Robot Framework Environment¶
In order to simplify the execution of Robot Framework tests, OpenTestFactory proposes a Docker image of such an execution environment: opentestfactory/robot-framework-runner.
Image content¶
Robot Framework libraries¶
- Robot Framework 6.1.1
- Browser library (keywords) 18.3.0: testing of Web applications
- Appium library (keywords) 2.0.0: testing of mobile applications
- RESTinstance (keywords) 1.3.0: testing of JSON Web services
- RequestsLibrary (keywords) 0.9.7: testing of Web services (this is a wrapper of the Python Requests Library)
- squash-tf-services (keywords) 2.0.0: retrieval of parameters defined by a ‘params’ function
- Allure Robot Framework Listener 2.13.5: required by OpenTestFactory in order to generate Allure reports
- lxml 5.0.0: Python xml parser
Tools¶
- Xvfb
- openssh-server
- x11vnc
Using the image¶
User profile¶
The image is designed to support running tests as otf
. Running tests as root
or any other non-otf
will result in issues.
Starting the image¶
docker run -d \
--name robotenv \
--env PASSWORD_ACCESS=true \
--env USER_PASSWORD=<secret password> \
opentestfactory/robot-framework-runner:latest
Note: If USER_PASSWORD
is not specified, the default password is otf
.
Running a test via ssh
¶
(We assume the test is accessible from within the image.)
ssh otf@<IP of the container> robot test_example.robot
The ssh
port is 22 by default. Use the SSHD_PORT
environment variable to change this value: docker run -d … --env SSHD_PORT=<your-port> …
to change it.
Xvfb¶
When using ssh
or docker exec
to run a test, the display 99 is loaded.
Using Chromium browser¶
Browser Library is built on top of Playwright. In order to be able to test with Chromium and Playwright inside a container, a copy of seccomp_profile.json
security settings is required, this file can be retrieved here. Some explanations can be found in Playwright documentation.
Using --ipc=host
is recommended, otherwise Chromium may run out of memory.
To summarize, the --ipc=host --security-opt seccomp=seccomp_profile.json
flags should be used:
docker run -d \
--name robotenv \
--env PASSWORD_ACCESS=true \
--env USER_PASSWORD=<secret password> \
--ipc=host \
--security-opt seccomp=path/to/seccomp_profile.json \
squashtest/agent-robotframework:latest"