我最近阅读了一篇文章,介绍了如何使用capybara的save_and_open_page
方法更容易地在黄瓜中进行调试测试。所以我安装了launchy
gem,在我的步骤定义文件中写了一个“Show me the page”步骤,然后尝试在我的一个功能文件中使用该步骤作为测试。这是我用黄瓜运行该功能文件时得到的结果:
Scenario: # features\training_records\view_training_records.feature:22
Given I am signed in as "Ajedi32" # features/step_definitions/login_system_steps.rb:5
And I am on the training class page for "Class 1" # features/step_definitions/training_class_steps.rb:13
And show me the page # features/step_definitions/debug_steps.rb:7
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\ajedi32\My Documents\Workspace\rails_app> And I click "View Training Records"
# features/step_definitions/navigation_steps.rb:12
Then show me the page # features/step_definitions/debug_steps.rb:7
1 scenario (1 passed)
9 steps (9 passed)
0m7.533s
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\ajedi32\My Documents\Workspace\rails_app>
什么???我甚至都不......
看起来save_and_open_page
正在将空白命令提示符的输出打印到我的控制台(是的,我正在运行Windows XP)。它也不会像预期的那样保存和打开页面。你们有没有任何线索在这里发生了什么?我当然不会......