Normalize spaces when getting element text #112

Closed
textgoeshere opened this Issue Jul 20, 2011 · 2 comments

3 participants

@textgoeshere

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.

@textgoeshere

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

@textgoeshere textgoeshere reopened this Jul 21, 2011
@sjain

+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