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

Change #text to be closer to what a browser displays #1982

merged 3 commits into from Mar 12, 2018

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 Mar 6, 2018
@twalpole
Copy link
Member Author

@twalpole twalpole commented Mar 8, 2018

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

@twalpole twalpole force-pushed the whitespace branch from 5e931c5 to 129759b Mar 12, 2018
@twalpole twalpole merged commit 90874d8 into master Mar 12, 2018
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@twalpole twalpole deleted the whitespace branch Jul 20, 2018
@@ -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')

This comment has been minimized.

@peetar

peetar Jan 9, 2019

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?

This comment has been minimized.

@twalpole

twalpole Jan 9, 2019
Author Member

@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.

This comment has been minimized.

@peetar

peetar Jan 9, 2019

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.