Skip to content
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

Merged
merged 3 commits into from Mar 12, 2018
Merged

Conversation

twalpole
Copy link
Member

@twalpole twalpole commented Mar 6, 2018

Playing with potential changes for Issue #1353

@twalpole twalpole force-pushed the whitespace branch 2 times, most recently from 6199a1e to 60df000 Compare March 6, 2018 21:13
@twalpole
Copy link
Member Author

twalpole commented Mar 8, 2018

@abotalov Any comments/feedback on this behavior as it relates to Issue #1353?

@twalpole twalpole merged commit 90874d8 into master Mar 12, 2018
@twalpole twalpole deleted the whitespace branch July 20, 2018 18:26
@@ -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')
Copy link

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?

Copy link
Member Author

@twalpole twalpole Jan 9, 2019

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.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants