0

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为这个点击操作创建一个单独的标记场景?

4

1 回答 1

0

好像没有。我得到了Gherkin::Parser::ParseError

../features/deleting_tickets.feature: Parse error at ../features/deleting_tickets.feature:17. 

Found step when expecting one of: examples, feature, scenario, scenario_outline, tag.
(Current state: tag). (Gherkin::Parser::ParseError)

于是又遇到了一个缺点。

于 2013-06-29T15:04:09.727 回答