Capybara 文档中的示例。他们标记了整个场景:
You can switch to the Capybara.javascript_driver (:selenium by default) by tagging scenarios (or features) with @javascript:
@javascript
Scenario: do something Ajaxy
When I click the Ajax link
...
但我只想标记一步:
Background:
Given I am on the homepage
And There is a button "Click me"
When I click the button "Click me"
@javascript
Then I should see a js pop-up element "Hello" within "#hello .hello"
这是可接受的行为吗?或者我是否需要@javascript
为这个点击操作创建一个单独的标记场景?