1

I'm having an issue running my RSpec suite. The suite is "old," and everything worked fine until a few days ago when system specs started to fail without an apparent reason. All the failures are related to the fact that JavaScript cannot finish. For instance, feedback messages or modals are not displayed. If I add sleep 1 before the expectations, the specs pass.

To make things stranger, failures happen only when I run the entire system specs (bin/rspec spec/system) or groups of them (bin/rspec spec/system/admin), but if I run single files (bin/rspec spec/system/admin/users/create_user_spec.rb) I have no failures.

I realize this is a very peculiar issue, and it isn't easy to provide suggestions, but does anyone have any ideas on how to fix it?

I'm using the latest release of rspec-rails, capybara, and selenium-web driver,

The failures occur only with headless Chrome (driven_by :selenium, using: :headless_chrome), if I switch to Chrome (driven_by :selenium, using: :chrome) every spec passes.

3
  • Can you add an example of a failing test? Commented Feb 17 at 13:53
  • 1
    We've observed the same behaviour lately. I don't think it's anything in the tests - as it's mentioned, the tests pass when using the regular chrome, or when they are run in isolation, and they fail when using headless chrome. We suspect something changed in the latest chrome releases, but couldn't track it down yet. Commented Feb 18 at 11:05
  • I'm think I'm having the same problem, with a newer test suite. Everything works fine with a visible browser, but seems like things go sideways near the end of the run if running headless. Commented Mar 21 at 19:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.