ChromeDriver for use in GitHub Actions
Features •
Quick Start •
Usage •
Platform Support •
Configuration •
Examples •
Contributing
Add this step to your workflow to automatically set up ChromeDriver:
- uses: nanasess/setup-chromedriver@v2
That’s it! ChromeDriver will be installed and added to your PATH.
The simplest way to use this action is without any parameters. It will automatically detect your Chrome version and install the matching ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- run: chromedriver --version
If you need a specific version of ChromeDriver:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '131.0.6778.87'
- run: chromedriver --version
If your Chrome binary has a custom name:
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
with:
chromeapp: chrome-beta
Platform | Versions |
---|---|
Ubuntu | ubuntu-latest , ubuntu-24.04 , ubuntu-22.04 |
macOS | macos-latest , macos-14 , macos-13 |
Windows | windows-latest , windows-2022 , windows-2019 |
Parameter | Description | Required | Default |
---|---|---|---|
chromedriver-version |
The ChromeDriver version to install | No | Auto-detected |
chromeapp |
Custom Chrome binary name (Linux/macOS only) | No | System default |
name: UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Start ChromeDriver
run: |
export DISPLAY=:99
chromedriver --url-base=/wd/hub &
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
- name: Run tests
run: npm test
name: Windows UI Tests
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Start ChromeDriver
run: chromedriver --url-base=/wd/hub &
- name: Run tests
run: npm test
name: Cross-Platform Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: nanasess/setup-chromedriver@v2
- name: Run tests
run: npm test
name: Chrome Version Test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: '131'
- uses: nanasess/setup-chromedriver@v2
with:
chromedriver-version: '131.0.6778.87'
- name: Run tests
run: npm test
Contributions are welcome! Here’s how you can help:
git checkout -b feature/amazing-feature
)yarn test
git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)
# Install dependencies
yarn install --frozen-lockfile
# Build the action
yarn build
yarn package
# Run tests
yarn test
# Format code
yarn format
For more details on the architecture and development process, see CLAUDE.md.
This project is licensed under the MIT License - see the LICENSE file for details.
If you find this action helpful, please consider: