Skip to content

Commit 7ae2f1d

Browse files
authored
Merge pull request #6 from lets-qa/codex/extend-dockerfile-to-include-xvfb
Add xvfb install and documentation
2 parents cd6aecf + 3ca47fd commit 7ae2f1d

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ FROM --platform=$TARGETPLATFORM ruby:3.2.2-slim
44
RUN apt-get update && apt-get install -y --no-install-recommends \
55
build-essential \
66
chromium \
7+
xvfb \
78
chromium-driver \
89
libpq-dev \
910
&& rm -rf /var/lib/apt/lists/*

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ This command launches the container with the current working directory set
4141
to `/app`, where your tests are mounted. From there you can run any
4242
commands you need, such as `bundle exec cucumber` or `bundle exec rspec`.
4343

44+
45+
If your tests require an X server, you can prefix the test command with
46+
`xvfb-run` to run them in a virtual framebuffer. For example:
47+
48+
```bash
49+
xvfb-run bundle exec rspec
50+
```
51+
4452
## Testing Watir
4553

4654
You can quickly verify that Watir is working inside the container by running a small script.
@@ -58,5 +66,4 @@ Run the script inside the container with:
5866

5967
```bash
6068
bundle exec ruby test_browser.rb
61-
```
62-
69+
```

0 commit comments

Comments
 (0)