黄瓜告诉我页面没有显示页面(解决方案:它是在错误的行)

时间:2013-01-04 10:54:46

标签: ruby-on-rails ruby cucumber

在黄瓜场景中添加“然后显示页面”这一行可以在我同事的计算机上使用相同的设置,但不是我的。事实上,添加一个暂停步骤定义并调用它似乎完全被忽略了。

步骤定义:

Then /^show me the page$/ do
  save_and_open_page
end

AfterStep('@pause') do
  print "Press Return to continue"
  STDIN.getc
end

特征:

(line 25) Scenario Outline: An authorised user visits the blah..,
Given a blah: ... blah ...
  And I am logged in as <role>
  And the date is 1 April 2012
When I go to the blah page
 And I click "foobar"
Then I should see "Blah foobar"
And I should see "Foobar on Mon Apr 1 00:00:00 2012 by <email>"
Then show me the page
And ...

命令行:

cucumber features/blah/foos.feature:25 --require features --tags @pause

使用Firefox 16.02(避免17中的错误)

这两台机器都有git-fetch'd,pull'd,bundle install'd所以所有宝石都是相同的,都使用Rbenv版本* 1.9.3-p327-perf。我可能会遗漏一些明显的东西......

更新:tmp / capybara /不包含该文件,因此现在没有保存...

感谢Beerlington的解决方案:向我展示页面排列的一个。在向我展示页面之前有失败,因此它没有显示出来。

1 个答案:

答案 0 :(得分:2)

从评论中复制答案,以便从“未答复”过滤器中删除此问题:

  

感谢Beerlington解决方案:将显示页面向上移动一个。在向我展示页面之前有失败,因此它没有显示出来。