I wanted to be able to switch between methods from the CLI when developing.
- Assume goutte most of the time (unless the test itself was tagged to
prefer @javascript)
- BUT to see where problems were, I wanted to see even the non-js ones in action on my screen.
My behat.yml:
default:
suites:
default:
paths:
- %paths.base%/features
contexts:
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
extensions:
Behat\MinkExtension:
goutte: ~
selenium2: ~
chrome:
extensions:
Behat\MinkExtension:
browser_name: chrome
default_session: 'selenium2'
Now, running 'behat' will use goutte mostly, but if I choose to run
behat -p chrome
I get the browser version of the same things running.
behat version 3.1.0
(I saw many docs saying it was "Behat\MinkExtension\Extension" - but I found it was "Behat\MinkExtension" - this may be a version thing.)