Clear fields in tests before filling them in

There seems to be an issue with capybara or chromedriver which results
in `fill_in` sometimes appending to an input rather than overwriting
[1], causing some tests to fail under certain circumstances.

Clearing fields before filling them in solves the issue.

Note we're now getting warnings on all tests using the rack driver. I
haven't found a way to avoid the `clear: :backspace` option in
non-JavaScript tests, so to avoid the annoying warnings we should reduce
the number of tests using the rack driver even more.

[1] See issue 2419 in https://github.com/teamcapybara/capybara/issues
This commit is contained in:
Javi Martín
2021-03-23 16:41:39 +01:00
parent 5538a1346b
commit de9c261c0e
2 changed files with 5 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ end
Capybara.exact = true
Capybara.enable_aria_label = true
Capybara.default_set_options = { clear: :backspace }
Capybara.disable_animation = true
OmniAuth.config.test_mode = true