diff --git a/Dockerfile b/Dockerfile index c2b1ceb..697e7f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ FROM --platform=$TARGETPLATFORM ruby:3.2.2-slim RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ chromium \ + xvfb \ chromium-driver \ libpq-dev \ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index 5404f22..b2fac41 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ This command launches the container with the current working directory set to `/app`, where your tests are mounted. From there you can run any commands you need, such as `bundle exec cucumber` or `bundle exec rspec`. + +If your tests require an X server, you can prefix the test command with +`xvfb-run` to run them in a virtual framebuffer. For example: + +```bash +xvfb-run bundle exec rspec +``` + ## Testing Watir 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: ```bash bundle exec ruby test_browser.rb -``` - +``` \ No newline at end of file