Closed jayp closed 9 years ago
This is useful. As a side note, I find using regexes a bit tedious, coming from Capybara. It would be cool if you could do just:
(has (content? "world"))
that would try to find the content within whole page.
@strika (has (text? "world")
should be equivalent to that.
Does regex?
only do an exact whole-string match? that seems counter intuitive to me, perhaps the default should be changed to just verify that the regex can match any substring.
Ok, i've just read up on the other PR - I understand now.
I think it's preferable to get #19 merged and update the examples to use the -in?
variants.
Hi @glenjamin - I am all for #19.
As for the request from @strika, I believe text-in?
is equivalent to content?
. I don't think text?
is the same, as it does an exact match. So, double yes for #19.
And yes, regex?
only does whole-string matches... as such it doesn't work for multi-line strings (a vast majority of pages!) because .
doesn't match newlines by default.
Yes, text-in?
is what I had in mind.
Add (?s) to regex to explicitly indicate to the users that it is needed to match multiline