I've got headless Chrome and Chrome working for my Rspec tests. I want a flag to switch between the two so I can see the tests happen when I want and hide them when I don't. How can I implement something like:
rspec --headless
Right now I just have this secret tied to a .env
var:
Capybara.javascript_driver = Rails.application.secrets.headless ? :headless_chrome : :chrome