Skip to content

Commit cf7a45a

Browse files
committed
Issue #18 - Allow to define the screen resolution as an environment variable
1 parent a29ecfe commit cf7a45a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ LABEL description Robot Framework in Docker.
66
VOLUME /opt/robotframework/reports
77
VOLUME /opt/robotframework/tests
88

9+
ENV SCREEN_COLOUR_DEPTH 24
10+
ENV SCREEN_HEIGHT 1080
11+
ENV SCREEN_WIDTH 1920
12+
913
RUN dnf upgrade -y\
1014
&& dnf install -y\
1115
chromedriver-61.0.3163.100-1.fc26\
@@ -30,5 +34,4 @@ RUN mv /usr/lib64/chromium-browser/chromium-browser /usr/lib64/chromium-browser/
3034

3135
ENV PATH=/opt/robotframework/bin:/opt/robotframework/drivers:$PATH
3236

33-
ENTRYPOINT ["xvfb-run", "--server-args=-screen 0 1920x1080x24 -ac", "robot", "--outputDir", "/opt/robotframework/reports", "/opt/robotframework/tests"]
34-
37+
ENTRYPOINT ["xvfb-run", "--server-args=-screen 0 ${SCREEN_HEIGHT}x${SCREEN_WIDTH}x${SCREEN_COLOUR_DEPTH} -ac", "robot", "--outputDir", "/opt/robotframework/reports", "/opt/robotframework/tests"]

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The versions used in the latest version are:
1717

1818
* Robot Framework 3.0.2
1919
* Robot Framework selenium2library 1.8.0
20-
* Firefox 55.0
21-
* Chromium 60.0
20+
* Firefox 57.0
21+
* Chromium 61.0
2222

2323
## Running the container
2424

@@ -33,3 +33,11 @@ This container can be run using the following command:
3333
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.
3434

3535
When running your tests, simply add `-e BROWSER=chrome` or `-e BROWSER=firefox` to the run command.
36+
37+
### Changing the container screen's resolution
38+
39+
It is possible to define the settings of the virtual screen in which the browser is run by changing several environment variables:
40+
41+
* `SCREEN_COLOUR_DEPTH` (default: 24)
42+
* `SCREEN_HEIGHT` (default: 1080)
43+
* `SCREEN_WIDTH` (default: 1920)

0 commit comments

Comments
 (0)