CircleCi not working with capybara test

I can not get my capybara test to work on circle ci, what should I do?

I keep getting:

Failure/Error: visit("en/hotels/#{hotelname}")

RuntimeError:
  Failed to make system call: ["/home/circleci/project/app/features/support/webdrivers/chromedriver", "--version"]

my configuration being:

version: 2.1

orbs:
  ruby: circleci/ruby@1.1.0
  node: circleci/node@2
  browser-tools: circleci/browser-tools@1.1.0

jobs:
  build:
    docker:
      - image: circleci/ruby:2.6-stretch-node-browsers-legacy
      - image: redis@sha256:54057dd7e125ca41afe526a877e8bd35ec2cdd33b9217e022ed37bdcf7d09673
      - image: redis:6.0
    steps:
      - checkout
      - ruby/install-deps
      # Store bundle cache
      - node/install-packages:
          pkg-manager: yarn
          cache-key: "yarn.lock"
  test:
    parallelism: 1
    docker:
      - image: cimg/ruby:2.7-node
      - image: circleci/postgres:9.5-alpine
        environment:
          POSTGRES_USER: user
          POSTGRES_DB: site
          POSTGRES_PASSWORD: ""
      - image: redis
    environment:
      BUNDLE_JOBS: "3"
      BUNDLE_RETRY: "3"
      PGHOST: 127.0.0.1
      PGUSER: user
      PGPASSWORD: ""
      RAILS_ENV: test
    steps:
      - checkout
      - ruby/install-deps
      - node/install-packages:
          pkg-manager: yarn
          cache-key: "yarn.lock"
      - run:
          name: Wait for DB
          command: dockerize -wait tcp://localhost:5432 -timeout 1m
      - run:
          name: Database setup
          command: bundle exec rails db:schema:load --trace
      - run:
          name: Wait for Redis
          command: dockerize -wait tcp://localhost:6379 -timeout 2m
          
      # Run rspec in parallel
      - ruby/rspec-test
      - ruby/rubocop-check

workflows:
  version: 2
  build_and_test:
    jobs:
      - build
      - test:
          requires:
            - build

I’ve also used the configuration suggested in:

@sgaco - it appears you are referencing the browser-tools orb in your config, but are not using it anywhere. You’ll want to add the command to install the browser tools.

orbs:
  browser-tools: circleci/browser-tools@1.1
jobs:
  build:
    docker:
      - image: cimg/ruby:2.7-browsers
    steps:
      - browser-tools/install-browser-tools

The link provided is a little dated, the circleci/ruby image referenced there contains the browsers and drivers pre-installed, however this leaves dated browsers in the image relatively quickly. The new cimg images do not. For more details, see this discuss post

.

1 Like