nanasess / setup-chromedriver

ChromeDriver for use in GitHub Actions
MIT License
116 stars 38 forks source link

Selenium Failing #180

Open antarr opened 1 year ago

antarr commented 1 year ago

I'm getting this error when running on github actions.

Selenium::WebDriver::Error::UnknownError:
            unknown error: Chrome failed to start: exited abnormally.
              (unknown error: DevToolsActivePort file doesn't exist)
              (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

.github/workflow/ci.yml

name: Tests
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main
concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true
permissions:
  contents: read
  pull-requests: write
jobs:
  rspec:
    env:
      RAILS_ENV: test
      DATABASE_URL: mysql2://root:password@127.0.0.1:3306/rails_development
      RUBYOPT: -EUTF-8
      SELENIUM_CHROME_HEADLESS: true
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:8.0
        env:
          MYSQL_DATABASE: rails_development
          MYSQL_ROOT_PASSWORD: password
        ports:
          - 3306:3306
        options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
          bundler-cache: true
      - name: Install Node
        uses: actions/setup-node@v1
        with:
          node-version: 14
      - name: Configure database
        run: |
          cp config/ci.database.yml config/database.yml
          cp config/ci.config.yml config/config.yml
          bundle exec rake db:structure:load db:migrate
 ##      - uses: browser-actions/setup-chrome@latest
 ##       with:
 ##         chrome-version: stable
      - name: Download chrome driver
        uses: nanasess/setup-chromedriver@master
      - name: Launch chrome driver
        run: |
          export DISPLAY=:99
          chromedriver --url-base=/wd/hub &
          sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional
      - name: Run Rspec Tests
        run: |
          bundle exec rspec spec --format progress
      - uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest
      - uses: aki77/delete-pr-comments-action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          bodyContains: "[undercover]"
          noReply: "true"
      - name: Run Undercover via Reviewdog
        env:
          REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          git fetch --no-tags
          reviewdog -reporter=github-pr-review -runners=undercover
nanasess commented 1 year ago

@antarr Is selenium-webdriver ruby binding? What version of selenium are you using?