name: E2E Tests on: [push] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - run: npm ci
If you have ever tried to set up a web automation suite (using Selenium WebDriver) on a new machine or a CI/CD pipeline, you know the drill. You download the ChromeDriver, make sure it matches your browser version, move it to /usr/local/bin , grant permissions, then do the same for GeckoDriver (Firefox) and EdgeDriver. selenium-standalone
Run your test while selenium-standalone start is running in another terminal. They will connect automatically. The CLI is great, but the real power is using the API inside your test setup hooks. name: E2E Tests on: [push] jobs: test: runs-on:
# Install drivers (runs fresh on every commit) - run: npx selenium-standalone install # Run server in background - run: npx selenium-standalone start & - run: npm test They will connect automatically
Then, three weeks later, your CI build fails because the browser auto-updated but the driver didn’t.