I've got a pretty elaborate end-to-end test suite driven by Jest and Puppeteer.
Puppeteer can be started Chrome in headless or headful mode:
puppeteer.launch({ headless: false });
I've dockerized the app and the test suite. It's running perfectly in headless mode, but I've lost the ability to run it in headful mode: my headful Chrome is on the Windows host, and my Puppeteer is in Docker in WSL, where a headless Chrome is installed.
How do I use host OS Chrome in headful mode when running Puppeteer tests in Docker?
In a different project, I've had a test suite start a dev server, offer an URL. I could open that URL in the host OS Chrome, and tests would run there. But Puppeteer seems more elaborate than that.
PS Homework
- This SO question links to this article that suggests starting a window manager inside the Docker container and connecting to it remotely in a VNC fashion. I don't like that, I want to use the actual Chrome app in my host OS (or any browser, for that matter).
- Another SO question, answer suggests the same approach, and here are VNC instructions.