开发者

If my "Then I should see" Cucumber feature is failing, how can I see what Cucumber is seeing?

Presumably if Cucumber is not seeing what I expect it to see, it must be seeing something else. Mirroring in my application开发者_如何学Go what I think the same steps are, I get the desired output.

This is a "signing in" feature. It appears that sign in is failing in the test. But unless I can see the error message, I don't know why it's failing!


Cucumber has a step called "show me the page" that works great! You can put it right where you want to view the page in your tests, like so:

  When I go to the sign in page
  Then show me the page # saves the HTML of that page and opens the file
  And I sign in as "email@person.com/password"
  Then I should see "Bad email or password"
  And I should be signed out

I believe you need the launchy gem to make this work. Here's an article that describes it, along with other cool cucumber tricks:

http://robots.thoughtbot.com/post/189412598/five-ridiculously-awesome-cucumber-and-webrat

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜