Skip to content

nanasess/setup-chromedriver

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ setup-chromedriver

A GitHub Action to set up ChromeDriver for automated testing

Test on Linux & macOS Test on Windows GitHub release License GitHub Sponsors

Features β€’ Quick Start β€’ Usage β€’ Platform Support β€’ Configuration β€’ Examples β€’ Contributing


✨ Features

  • πŸ”§ 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

πŸš€ Quick Start

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.

πŸ“– Usage

Basic Usage

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

Specify 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

Custom Chrome Binary

If your Chrome binary has a custom name:

steps:
  - uses: actions/checkout@v4
  - uses: nanasess/setup-chromedriver@v2
    with:
      chromeapp: chrome-beta

πŸ–₯️ Platform Support

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

βš™οΈ Configuration

Input Parameters

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

πŸ“š Examples

Running Tests on Ubuntu/macOS with Xvfb

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

Running Tests on Windows

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

Matrix Testing Across Platforms

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

Testing with Specific Chrome Version

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

🀝 Contributing

Contributions are welcome! Here's how you can help:

  1. 🍴 Fork the repository
  2. πŸ”§ Create your feature branch (git checkout -b feature/amazing-feature)
  3. πŸ’» Make your changes
  4. βœ… Run tests with yarn test
  5. πŸ“ Commit your changes (git commit -m 'Add amazing feature')
  6. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
  7. πŸ”„ Open a Pull Request

Development Setup

# 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.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Thanks to all contributors who have helped improve this action
  • Special thanks to the ChromeDriver team for their excellent work

πŸ’– Support

If you find this action helpful, please consider:


Made with ❀️ by @nanasess