2012-08-07 70 views
2

我想根據示例中的標籤應用不同的VCR盒。據我所知,標記黃瓜場景大綱的例子是可能的,但我不能讓VCR識別任何標籤。這可能嗎?如何標記黃瓜場景大綱的例子用於錄像帶盒?

VCR.cucumber_tags do |t| 
    t.tag '@premium-successful-payment' 
    t.tag '@premium-card-declined' 
end 


Feature: 

    Background: 
    Given I am signed in 
    And I am on the premium payment page 

    @javascript 
    Scenario Outline: Submitting payment information 
    When I fill in "Credit Card Number" with "<card_number>" 
    And I fill in "Security Code" with "<security_code>" 
    And I select "<expires_month>" from "credit_card_expires_month" 
    And I select "<expires_year>" from "credit_card_expires_year" 
    And I press "Activate Premium" 
    Then I should see a payment success message 

    @premium-successful-payment 
    Examples: 
     | card_number  | security_code | expires_month | expires_year | 
     | 4242424242424242 | 123   | 6    | 2020   | 

    @premium-card-declined 
    Examples: 
     | card_number  | security_code | expires_month | expires_year | 
     | 4000000000000002 | 123   | 6    | 2020   | 

回答

1

在github上有關於此的open Pull Request。我想在某個時候合併它,但我對實現有一些擔憂,公關的作者尚未回覆我的評論。同時,您可以考慮使用可用的黃瓜掛鉤和VCR的VCR.insert_cassette/VCR.eject_cassette API編寫自己的VCR /黃瓜集成。黃瓜整合並不意味着人們使用黃瓜VCR的主要方式或唯一方式;這只是爲了滿足最常見的需求而開始的一種便捷方式。

相關問題