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
Change #text to be closer to what a browser displays #1982
Conversation
6199a1e
to
60df000
Compare
@@ -17,7 +17,7 @@ | |||
|
|||
it "should find the ancestor element using the given locator and options" do | |||
el = @session.find(:css, '#child') | |||
expect(el.ancestor('//div', text: 'Ancestor Ancestor Ancestor')[:id]).to eq('ancestor3') | |||
expect(el.ancestor('//div', text: "Ancestor\nAncestor\nAncestor")[:id]).to eq('ancestor3') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After upgrading our gems, we ended up with a few hundred test failures requiring an update like this. (Yes, we foolishly assumed the whitespace normalization would never change and used this pattern all over our test suite). Anybody have a suggestion on how we might solve this without having to manually update a whole bunch of assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peetar You can use Capybara.default_normalize_ws = true
- although that will most likely go away in Capybara 4 - so you're going to want to update your tests to check what a user actually sees at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, might use it as a temporary workaround
Playing with potential changes for Issue #1353