Skip to content

Instantly share code, notes, and snippets.

@andrewmcodes
Last active February 3, 2021 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewmcodes/f86a83e95e95a66d7e688f6c0d97b9d6 to your computer and use it in GitHub Desktop.
Save andrewmcodes/f86a83e95e95a66d7e688f6c0d97b9d6 to your computer and use it in GitHub Desktop.
easily toggle between headless and browser in your system tests
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# Watch tests execute in the browser with `WATCH=true` in your environment
# ex: WATCH=true bin/rails test:system
driven_by :selenium, using: ENV["WATCH"] == "true" ? :chrome : :headless_chrome
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment