Capybara, Cucumber, GWT problem asserting the text with inline styles
I was to check to see if a text with inline styles exist.
For example page.should have_content(text)
works for raw text such as
"Time out"
,
however it does not work for the text
"Tim开发者_StackOverflow中文版e out. Please <a href=#">Click</a> here to retry".
Also I have been having trouble trying to locate an anchor with inline style as well ex:
<a>click <strong>here</strong>to retry</a>
.
Thanks.
You are correct that have_content tests for text, not markup. You can do this though:
page.body.should include('... <a>...</a> ...')
Regarding your second question, I don't think it's possible to do page.has_link?
with markup. You would have to construct your own XPath expression and then use page.should have_selector(:xpath, '...')
. Or test for the raw HTML using page.body
of course.
精彩评论