2016-12-12 2 views
0

Im имея behat.yml, который выглядит какBehat многократного профиля

machine: 
    suites: 
    machine: 
     contexts: 
     - MachineContext: 
location: 
    suites: 
    location: 
     contexts: 
     - LocationContext: 

И когда я бег behat -c behat.yml --profile machine его запустить все мои сценарии правильно, но когда я бег behat -c behat.yml --profile location его запустить сценарии рум location.feature и добавляет scenariose формы machine.feature и говорит мне, что Im missing then

+0

Вы используете Symfony? – BentCoder

+0

@BentCoder no Im not –

ответ

0

я узнал, что мне нужно, чтобы добавить paths в моей конфигурации профиля, который теперь мой behat.yml выглядит как

machine: 
    suites: 
    machine: 
     paths: 
     - %paths.base%/features/machine.feature 
     contexts: 
     - MachineContext: 
location: 
    suites: 
    location: 
     paths: 
     - %paths.base%/features/location.feature 
     contexts: 
     - LocationContext: 
0

Вы можете вдохновить на этот пример. Отрегулируйте его для ваших нужд.

default: 
    extensions: 
    Behat\MinkExtension: 
     sessions: 
     default: 
      symfony2: ~ 
    Behat\Symfony2Extension: 
     kernel: 
     env: test 
     debug: true 

machine: 
    extensions: 
    Behat\MinkExtension: 
     base_url: 'http://machine.domain.com/app_test.php/' 
    suites: 
    default: 
     contexts: 
     - Path/To/Your/Context/Machine1Context: 
      - 'constructor parameter if you have any' 
      - 'and another one' 
     - 'Path/To/Your/Context/Machine2Context' 

     type: symfony_bundle 
     bundle: Whatever1YourBundle 

location: 
    extensions: 
    Behat\MinkExtension: 
     base_url: 'http://location.domain.com/app_test.php/' 
    suites: 
    default: 
     contexts: 
     - 'Path/To/Your/Context/LocationContext' 

     type: symfony_bundle 
     bundle: Whatever2YourBundle 

Или вы можете просто использовать suites версию, как здесь: Installing behat3 with composer.json

Смежные вопросы