2016-03-30 12 views
0

\Codeception\Moduleクラスを拡張するヘルパークラスにコンフィグパラメータを渡すことは可能ですか? 次のような場合があります。を設定し、cofigプロパティを設定するために、モジュール有効化セクションのapi.suite.yml設定ファイルに設定します。CodeCeption - ヘルパーにオプションを渡す

私の考えは、異なる設定プロパティを持つ異なる環境を持つことです。 これは可能ですか?

class_name: ApiTester 
modules: 
    enabled: 
     - \Helper\Api:  # This is my module 
     my_path: C://ssss # This is my custom option I want to pass. 

My module class。

class Api extends \Codeception\Module 
{ 
    protected $requiredFields = ['my_path']; 
    ... 
} 

私はそれが失敗したとスイート走ったとき:

[Codeception\Exception\ModuleConfigException] 
    Helper\Api module is not configured! 

    Options: my_path are required 
    Please, update the configuration and set all the required fields 
+0

あなたがhttp://codeception.com/docs/06-を読みましたReusingTestCode#Configuration? – Naktibalda

+0

はい、私はそれを読んで、私は説明どおりにすべてを作ったと思います。 – bozhidarc

答えて

1

をあなたは、パラメータの詳細をインデントする必要がありました: class_name: ApiTester modules: enabled: - \Helper\Api: # This is my module my_path: C://ssss # This is my custom option I want to pass.

+0

ロック!ありがとうございました! – bozhidarc

関連する問題