-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintain Capybara 2 behavior for Capybara 3 #95
Comments
I thought of this myself. What kept me from suggesting it is that I don't think we should try to polyfill Capybara. On the other hand I have seen people just overwriting the |
I agree we should avoid making developers copy (overridden!) steps from project to project and instead give them a step that just works™ – after all that's what Spreewald is about. We tried and overrode the We also tried to add a modified step I do not think we should ever consider newlines, tabs etc in the |
@makmic found a nice solution to this: You can set
We tested this in 3 of our lager projects and it worked like a charm. But we both prefer to set a project default for Capabara's whitespace stripping as long as it is possible, so that everyone can use it the way (s)he wants. I'm closing this for now as I don't see a need for further discussion. If you don't agree please feel free to reopen the issue :) |
The global |
Quick follow-up: we should tell users about the Capybara option. A couple of ideas:
I would suggest to add 1 and 3. |
Capybara 3 has changed the
page.has_text?
method that is used e.g. by theI should (not) see …
steps to respect white space, including\n
. This breaks tests that rely on the previous behavior, which normalized all white space like Rails'squish
.Fortunately, the
has_text?
method takes options and passes them toassert_text
. This method takes a:normalize_ws
option that restores the previous behavior if set totrue
:https://github.com/teamcapybara/capybara/blob/5146c4aa1f7bd95a0520582aa34ecf55243ea313/lib/capybara/node/matchers.rb#L662
An update for the
I should see …
steps could look like this:The text was updated successfully, but these errors were encountered: