Open cowboyd opened 3 years ago
One posible strategy would be instead of trimming the element locator, to always wrap the locator in a matcher. The default would be trimmed
, but we could also have a strictEquals
locator that that did a ===
as its match. So that if it was what you really wanted you could match that.
Ugh, this is annoying. IIRC Capybara does trim the text, which seems reasonable since whitespace is very rarely relevant in HTML documents anyway. I think the HTML
interactor could do this, that way it'd still be overridable if someone really wants to.
Most interactors override the locator method. So I think we should implement trimming on the internal level, like adding the special trim
matcher.
Safari includes up to one newline in its
innerText
property for elements. Why, I'm not sure, but it ends up that you don't match your selectors on different platforms:Should we trim the selector before matching against it?