Manuals / Selenium WebDriver / Chapter 9
D · Delivery · intermediate · Week 7–8 · Chapter 9 of 12
Selenium in CI
Headless Chrome in GitHub Actions. Cache dependencies, upload screenshots on failure, smoke on PR, full suite nightly.
Path progress69%
Step 1 of 3
GitHub Actions workflow
setup-java or setup-python, install browsers, run pytest/testng, upload reports.
Example
name: Selenium Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install -r requirements.txt
- run: pytest -m smoke --headless
- uses: actions/upload-artifact@v4
if: failure()
with:
name: selenium-screenshots
path: screenshots/Do this now
Green workflow on push. Headless Chrome.
Was this step clear?
Chapter learning outcomes
- Headless Chrome in CI
- Artifact upload
- Service containers
- Retry strategy
Clear these before you leave
Side quest
Fix CI flake
If CI fails but local passes, fix wait or headless viewport — document in FLAKES.md.