jeudi 31 mars 2016

How to get Symfony profiler in Behat Test

I was wondering on how to get the Symfony profiler within a behat test? I've read the offical docs about it but I keep getting the error

"You need to tag the scenario with @mink:symfony2".

I think this is a configuration problem:

behat.yml

default:
  suites:
    default:
      contexts:
       - FeatureContext:
           em: '@doctrine.orm.entity_manager'
           router: '@router'
           tokenStorage: '@security.token_storage'
           encoder: '@security.password_encoder'
           session: '@session'

  extensions:
    Behat\Symfony2Extension: ~
    Behat\MinkExtension:
      base_url: "http://ift.tt/1Mxg9E2"
      goutte: ~
      selenium2:
        wd_host: "http://ift.tt/MlyWIA"
      sessions:
        default:
          symfony2: ~

config_test.yml

framework:
  test: ~
  session:
    storage_id: session.storage.mock_file
  profiler:
    collect: true

web_profiler:
  toolbar: false
  intercept_redirects: false

swiftmailer:
  disable_delivery: true

My feature context extends MinkContext and I am using Selenium for driving my tests that require javascript. I've tagged the feature that I want to execute the following:

@mink:symfony2
@javascript
Scenario: User send mail
# ...

Aucun commentaire:

Enregistrer un commentaire