Skip to content

Commit c4f2042

Browse files
pftgclaude
andcommitted
docs: add development guide for Docker testing and screenshot recording
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e1154c4 commit c4f2042

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,37 @@ You can also run `bin/console` for an interactive prompt that will allow you to
666666

667667
To install this gem onto your local machine, run `bundle exec rake install`.
668668

669+
### Running tests in Docker
670+
671+
Screenshot tests depend on exact browser rendering, which varies across OS and browser versions. Use `bin/dtest` to run tests inside Docker for consistent, reproducible results matching CI:
672+
673+
```bash
674+
bin/dtest # Run all tests with all drivers
675+
bin/dtest test/integration/ # Run specific test directory
676+
```
677+
678+
This builds a Docker image with Chrome and runs the test suite against three Capybara drivers: `cuprite`, `selenium_chrome_headless`, and `selenium_headless`.
679+
680+
#### Recording baseline screenshots
681+
682+
Screenshot baselines are committed to the repo and compared against during tests. When you set up the project for the first time, or after upgrading the browser/driver, you need to re-record them:
683+
684+
```bash
685+
RECORD_SCREENSHOTS=1 bin/dtest
686+
```
687+
688+
This skips screenshot comparisons and saves new baselines instead. Without this step, tests will fail because your local browser renders pixels differently from the previously committed baselines.
689+
690+
#### Experimental: Lightpanda browser
691+
692+
[Lightpanda](https://github.com/lightpanda-io/browser) is included as an experimental CDP-based headless browser. It can be enabled for the `cuprite` driver:
693+
694+
```bash
695+
ENABLE_LIGHTPANDA=1 bin/dtest
696+
```
697+
698+
**Note:** Lightpanda's CDP support does not yet cover viewport resizing or full execution context management, so screenshot comparison tests may fail. This is gated behind the env var until Lightpanda matures.
699+
669700
## Contributing
670701

671702
See [CONTRIBUTING.md](CONTRIBUTING.md)

0 commit comments

Comments
 (0)