2014-02-24 58 views
12

我知道的方式來運行只有標有選擇@tag測試:可以用Behat排除標籤嗎?

@invite 
Feature: As User I want to invite a friend to join on MySocial 

    @mytag 
    Scenario: Exists a Facebook user 
    Given I go to "/" 
    When I follow "Invite a friend" 
    ... 

是有可能這樣做完全相反?

回答

34

是的,這是可以排除標籤或命令行的標籤列表:

behat --tags '~[email protected]' 

它也可以設置排除(幷包括)標籤在behat.yml的輪廓。

貝哈特2.x的

default: 
    filters: 
    tags: "[email protected]&&[email protected]&&[email protected]" 

在上面的例子中我排除任何真實功能標籤@wip(工作正在進行中),@postponed@disabled

貝哈特3.X

在貝哈特3,你不僅可以配置標籤配置文件,也爲套房。語法是有點不同:

default: 
    gherkin: 
     filters: 
      tags: "[email protected]&&[email protected]" 

suites: 
    admin: 
     filters: 
      tags: "@admin" 

相關文檔

+0

我不知道你是否有解決方案[此帖](http://stackoverflow.com/questions/26383870/runing-behat-tests-in-parallel-in-two-browser-windows)? – BentCoder

3

如果你只想做這樣的Jakub一個標籤說:

behat --tags '[email protected]' 

,如果你想與像@Done標籤運行多個場景而不是@javascript:

behat --tags '@Done&&[email protected]'