2016-04-26 30 views
0

私は機能フォルダをルートディレクトリとし、サブディレクトリ内に2つの機能コンテキストクラスを持つpublicというフォルダを持っています。 SignIn.phpとPostProject.php私のコンテキストクラスを見つけることができません

behat.ymlファイル内のコンテキストクラスへのパスを指定しましたが、コンテキストクラスが見つからず使用できないことを教えてくれますか?私は本当にそれを見つけることができない方法を得ることは本当にありません。

この問題を解決する方法がわかりません...私には正しいように見えますが、何が間違っているのかわかりません。

本当にありがとうございます。以下は私のbehat.ymlファイルです

default: 
    suites: 
     public: 
      paths:  [%paths.base%/features/public] 
      contexts: 
       - PostProject 
       - SignIn 
       - Behat\MinkExtension\Context\MinkContext 
    extensions: 
     Behat\MinkExtension: 
     goutte: ~ 
     selenium2: ~ 

答えて

0

私は答えを見つけました。

コンテキストクラスは名前空間によってオートロードされる必要があります。また、behat.ymlファイルで指定する必要があります。パスのコンテキストは、機能テスト(test.feature)のために使用されている。ここ

をファイル改訂.ymlファイルが

default: 
    autoload: 
     '': %paths.base%/features 
    suites: 
     public: 
      paths:  [%paths.base%/features] 
      contexts: 
       - public1\PostProject 
       - public1\SignIn 
       - Behat\MinkExtension\Context\MinkContext 
     client: 
      paths:  [%paths.base%/features] 
      contexts: 
       - Client 
    extensions: 
     Behat\MinkExtension: 
     goutte: ~ 
     selenium2: ~ 

コンテキスト・クラス

namespace public1; 

date_default_timezone_set("America/New_York"); 
use Behat\Behat\Context\Context; 
use Behat\Behat\Context\SnippetAcceptingContext; 
use Behat\Behat\Hook\Scope\BeforeScenarioScope; 

/** 
* Defines application features from the specific context. 
*/ 
class SignIn implements Context, SnippetAcceptingContext 
{ 
//Content here 
} 



namespace public1; 

date_default_timezone_set("America/New_York"); 
use Behat\Behat\Context\Context; 
use Behat\Behat\Context\SnippetAcceptingContext; 
use Behat\Behat\Hook\Scope\BeforeScenarioScope; 

/** 
* Defines application features from the specific context. 
*/ 
class PostProject implements Context, SnippetAcceptingContext 
{ 
//Content here 
} 
の例であります
関連する問題