Webrat says it can't find some text, but the text is actually there
- by Jason
I have a webpage that has a form button on it called "delete", and a cuke scenario that has the line:
And I should see "delete"
When I run the scenario, I get this error:
expected the following element's content to include "delete"
...and it dumps the webrat page to stdout and the "delete" is, in fact, not there. So far so good. However, when I tell webrat to show me the page before the error happens:
Then show me the page
And I should see "delete"
...Safari fires up and shows me the page, and in Safari there's the "delete" button, totally there.
Why is webrat not finding the form button? I've also had this same problem with form fields, such as text inputs that have a value in them when the page loads, but webrat says there's nothing there. Looking at it in Safari shows, again, that the field does have the right text in it.
Is this a bug, or is webrat just not suitable for checking form elements? Is there a different way to do this? Thanks!