ruby-on-rails - cucumber 显示页面未显示页面(解决方案: it was on the wrong line)

标签 ruby-on-rails ruby cucumber

将“然后向我显示页面”行添加到 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,因此所有 gem 都是相同的,都使用 Rbenv 版本 * 1.9.3-p327-perf。我可能遗漏了一些明显的东西......

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

感谢 Beerlington 的解决方案:将显示的页面向上移动一位。在显示页面之前出现故障,因此没有显示。

最佳答案

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

Solution thanks to Beerlington: Move the show me the page line up one. There was failure before show me the page, thus it did not get shown.

关于ruby-on-rails - cucumber 显示页面未显示页面(解决方案: it was on the wrong line),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14155775/

相关文章:

ruby-on-rails - Rails 内存泄漏 : controller class holding a reference to instance

ruby - 使用 Lucene Parser 和 Solr 使用 Sunspot 进行多字段搜索

ruby-on-rails - 使用 OR 的 Sunspot/SOLR 查询

ruby-on-rails - 修复 "ruby installation is missing psych"错误?

html - 有没有一种方便的方法在纯 HTML 上对 MVC 框架(Rails 或类似框架)的 View 层的 future 结构进行原型(prototype)设计?

ruby-on-rails - mongoid 有没有办法使用整数(数字)作为默认 id 而不是长哈希值?

ruby - 在什么情况下Linux epoll_wait会返回epoll_events结构体并带有空的events字段?

javascript - webdriverio - 如何将 LI 文本放入数组

java - Cucumber 4.7.2 将表转换为行到对象

javascript - 我如何在 Capybara 中测试页面是否*未*重新加载(JavaScript onClick 拦截有效)?