mardi 23 janvier 2018

Web server not starting on Rails 5.1 system test

I am following the edge guide to create my first system test. When I run

bin/rails test:system

The browser opens with correct url but I don't think a web server is running (no site displays) so I get failure that test cannot find screen text.

However, if I have my development server running the test runs but uses development database. How do I get the test environment to launch web server?

Not sure if it matters but I am using rails 5.1 with webpacker. To launch development I run

foreman start -f Procfile.dev-server 

Procfile.dev-server

web: rails s -p 3000
client: sh -c 'rm -rf public/packs/* || true && bundle exec rake react_on_rails:locale && bin/webpack-dev-server'

My test/application_system_test_case.rb looks like:

require "test_helper"

class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
  #driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
  driven_by :selenium, using: :chrome, screen_size: [1400, 1400]
end

Aucun commentaire:

Enregistrer un commentaire