简体   繁体   中英

Rails 5 System Tests won't stay in background! (Capybara with Selenium and Chrome)

When I run my massive suite of Capybara "system" tests, the automated Chrome window constantly takes focus! It basically means I can't work while the test is running. This is driving me insane. Is there anything I can do? It didn't do this until recently.

Gems:

  • rails 5.2.0
  • capybara 3.0.3
  • selenium-webdriver 3.12.0
  • chromedriver-helper 1.2.0

You haven't configured your selenium webdriver correctly. From my 5.2 app:

# spec/rails_helper.rb
require 'capybara/rspec'                                                                
Capybara.javascript_driver = :selenium_chrome_headless

除了以无头模式运行(或向Chrome开发人员提出问题并希望他们在以后的Chrome版本中更改行为)之外,您无能为力

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM