Hello! I have a Ruby on Rails app that I'm using bitbucket pipelines to deploy to Heroku. I have tests in the app that use minitest, capybara, selenium, and webdrivers. For system tests, I have an application_system_test_case.rb file with this class that specifies the headless chrome browser and the system test files inherit from it:
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, using: :headless_chrome, screen_size: [1400, 1400]
end
I've gotten the normal tests (model, controller, helper, etc) to successfully run in the pipeline, but if I try to run the system tests, I get errors related to the chrome browser not running properly. I've tried various ideas, but haven't been able to get it to work. Here is my bitbucket-pipelines.yml:
image: ruby:2.6.6
pipelines:
branches:
dev:
- step:
name: Deploy dev branch
deployment: test
caches:
- bundler
- yarn
script:
# install nodejs & yarn
- apt-get update && apt-get install -y build-essential nodejs
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
- apt-get update
- apt-get install -y yarn
- yarn install
# install gems
- gem install rails
- bundle install --path vendor/bundle
# set up postgres
- export DATABASE_URL=postgresql://test_user:test_user_password@localhost/pipelines
- bundle exec rake db:create db:migrate --trace RAILS_ENV=test
- bundle exec rails test
- git push [to server]
services:
- postgres
definitions:
caches:
bundler: ./vendor
yarn: ./node_modules
services:
postgres:
image: postgres
environment:
POSTGRES_DB: pipelines
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
Anyone know how to get this to work?