Skip to content

Commit afe8e98

Browse files
forkataadammathysAlistairNormanNoah-Silvera
committed
Pass driver capabilities to selenium_chrome
This will allow us to run feature specs headless by just overriding the CAPYBARA_DRIVER ENV variable by passing `selenium_chrome` as the driver. Co-authored-by: Adam Mueller <adam@super.gd> Co-authored-by: Alistair Norman <alistair@super.gd> Co-authored-by: Noah Silvera <noah@super.gd>
1 parent a253832 commit afe8e98

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • storefront/templates/spec/support/solidus_storefront

storefront/templates/spec/support/solidus_storefront/capybara.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
config.before(:each, type: :system, js: true) do |example|
1616
screen_size = example.metadata[:screen_size] || [1800, 1400]
17-
driven_by(:selenium, using: :headless_chrome, screen_size: screen_size) do |capabilities|
17+
using = ENV["CAPYBARA_DRIVER"] == "selenium_chrome" ? :chrome : :headless_chrome
18+
19+
driven_by(:selenium, using: using, screen_size: screen_size) do |capabilities|
1820
capabilities.add_argument("--disable-search-engine-choice-screen")
1921
capabilities.add_preference("autofill.profile_enabled", false)
2022
capabilities.add_preference("autofill.credit_card_enabled", false)

0 commit comments

Comments
 (0)