2016-03-21 2 views
1

私が探しているものが可能であるかどうかは不明です。単一のコンテキストのリスト定義

私はbehatを使用しています。私たちはいくつかのチームが同じベースコードで作業しています。 したがって、互換性のない多くの文の定義があります。

私は文脈で、例えばbehat -dlのような文章を挙げたいと思いますが、単一の文脈ファイル(またはそれらのリストに名前を付けることができればさらに良い)からの取り出しだけです。

これは可能でしょうか?

編集:追加behat -di出力

... 
Then /^the response status code should be (?P<code>\d+)$/ 
    - Checks, that current page response status is equal to specified. 
    # FeatureContext::assertResponseStatus() 

Then /^the response status code should not be (?P<code>\d+)$/ 
    - Checks, that current page response status is not equal to specified. 
    # FeatureContext::assertResponseStatusIsNot() 

Then /^(?:|I)should see "(?P<text>(?:[^"]|\\")*)"$/ 
    - Checks, that page contains specified text. 
    # FeatureContext::assertPageContainsText() 

Then /^(?:|I)should not see "(?P<text>(?:[^"]|\\")*)"$/ 
    - Checks, that page doesn't contain specified text. 
    # FeatureContext::assertPageNotContainsText() 
... 

答えて

0

はまあボックスのうちはそのような解決策はありません。しかし! grep機能を使用できます。 F.e.

./bin/behat -di| grep "Test\\\\Context\\\\FeatureContext" 

注:あなたは、次のコマンドを使用することができますファイルによって結果をフィルタリングするのであれば

TestSuite | When /^I am searching with "([^"]*)" text$/ 
      | at `Test\Context\FeatureContext::simpleSearch()` 

./bin/behat -di 

は、テスト手順について、拡張情報をあなたになります:バックスラッシュは\\\\のように扱われます。this problem

のためです0

更新:ソリューションは、スイート機能を使用してBehatバージョン> 3にのみ適用されます。

+0

私にとってはうまくいかない。私はv2.4を使用しているのでそれができますか? – mloureiro

+0

hm、正確には動作しませんか? './bin/behat -di'は出力を生成しますか?はいの場合は、それを貼り付けて、実行しているコマンドをgrepで貼り付けることができます –

関連する問題