2013-06-29 63 views
0

來自Capybara文檔的示例。他們吊牌全場景:水豚:是否可以在場景中標記`@ javascript`只有一步?不是整個場景?

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已標記的情景?

回答

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) 

所以一個更不利的滿足。

相關問題