seleniumbrowserbehatmink

How to leave the browser open when a Behat/Mink test fails


I'm using the selenium2 driver to test my Drupal site using Behat/Mink in a docker container.

Using the Selenium Standalone-Chrome container, I can watch my behat tests fail, but the problem is that as soon as they fail, the browser is closed, which makes it harder for me to see what the problem is.

I'm running my tests like this:

behat --tags '@mystuff' --config=behat-myconfig.yml --strict --stop-on-failure

Is there a way to leave the remote-controlled browser open even when a test fails?


Solution

  • Finally I found a good solution for this: behat-fail-aid.

    Add the fail aid to your FeatureContext and then run behat with the --wait-on-failure option:

    the --wait-on-failure={seconds} option can be used to investigate/inspect failures in the browser.