Sig
Sig

Reputation: 5986

RSpec system specs fail without allowing JS to finish

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.

Upvotes: 1

Views: 60

Answers (0)

Related Questions