Skip to content
This repository

Normalize spaces when getting element text #112

Closed
textgoeshere opened this Issue · 2 comments

3 participants

Dave Nolan Sharad Jain Matthew Mongeau
Dave Nolan

In order to compare strings easily in our specs and to be compatible with Selenium, spaces should be normalized in text content.

When Selenium returns the text of a node, it locates the node using the @normalize-space@ XPath function. But Capybara-Webkit returns the raw text as it is represented on the page. This means specs that pass with Selenium may not pass in Capybara-Webkit, and it makes testing for the presence of strings harder.

We have worked around this issue with @gsub@s where necessary but ultimately Capybara-Webkit should return normalized strings for compatibility.

Dave Nolan

Here's our klidge if anyone is interested: textgoeshere/capybara-webkit@752ab7e

Dave Nolan textgoeshere reopened this
Sharad Jain

+1.
The issue is valid and the fix is correct. Has this been merged into main repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.