A GitHub Action to set up ChromeDriver for automated testing
Features • Quick Start • Usage • Platform Support • Configuration • Examples • Contributing
- 🔧 Automatic Version Matching - Automatically installs ChromeDriver that matches your Chrome browser version
- 🖥️ Cross-Platform - Works on Ubuntu, macOS, and Windows
- ⚡ Fast Setup - Quick installation with minimal configuration
- 🎯 Version Control - Option to specify exact ChromeDriver version
- 🛠️ Custom Chrome Binary - Support for custom Chrome binary names
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:
- 🍴 Fork the repository
- 🔧 Create your feature branch (
git checkout -b feature/amazing-feature
) - 💻 Make your changes
- ✅ Run tests with
yarn test
- 📝 Commit your changes (
git commit -m 'Add amazing feature'
) - 📤 Push to the branch (
git push origin feature/amazing-feature
) - 🔄 Open a Pull Request
# 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.
- Thanks to all contributors who have helped improve this action
- Special thanks to the ChromeDriver team for their excellent work
If you find this action helpful, please consider:
- ⭐ Starring the repository
- 💬 Sharing it with others who might benefit
- 💰 Sponsoring the maintainer
Made with ❤️ by @nanasess