File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .git
2+ .github
3+ * .md
4+
5+ # Ignore bundler and gem artifacts
6+ .bundle /
7+ vendor /
8+
9+ # Ignore temporary or log files
10+ log /
11+ tmp /
12+ * .log
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55 build-essential \
66 chromium \
77 xvfb \
8+ chromium-driver \
89 libpq-dev \
910 && rm -rf /var/lib/apt/lists/*
1011
Original file line number Diff line number Diff line change @@ -41,9 +41,29 @@ This command launches the container with the current working directory set
4141to ` /app ` , where your tests are mounted. From there you can run any
4242commands you need, such as ` bundle exec cucumber ` or ` bundle exec rspec ` .
4343
44+
4445If your tests require an X server, you can prefix the test command with
4546` xvfb-run ` to run them in a virtual framebuffer. For example:
4647
4748``` bash
4849xvfb-run bundle exec rspec
4950```
51+
52+ ## Testing Watir
53+
54+ You can quickly verify that Watir is working inside the container by running a small script.
55+
56+ ``` ruby
57+ # test_browser.rb
58+ require ' watir'
59+ browser = Watir ::Browser .new (:chrome , headless: true )
60+ browser.goto(' https://example.com' )
61+ puts browser.title
62+ browser.close
63+ ```
64+
65+ Run the script inside the container with:
66+
67+ ``` bash
68+ bundle exec ruby test_browser.rb
69+ ```
Original file line number Diff line number Diff line change 1+ require 'watir'
2+
3+ browser = Watir ::Browser . new ( :chrome , headless : true )
4+ browser . goto ( 'https://example.com' )
5+ puts browser . title
6+ browser . close
You can’t perform that action at this time.
0 commit comments