These are chat archives for Behat/Behat
@bdunogier Yeah, that's an issue with DrupalExtension as well. Since there is only 1 PHP process that's loaded when running tests, if you are bootstrapping your php app (including your app php files) inside your tests, then things like shutdown functions won't work (until all your tests are done, which is usually too late). For Drupal, we end up identifying these issues on a per case basis and either do the processing or cache clearing as needed in tests. Also, we usually only use the direct API for doing setup and teardown (or Given steps), and still use regular Mink requests to look for the results on the actual page. I'd recommend setting up a debugger where you can have more than one concurrent Xdebug sesssion (PHPStorm if you increase max connections) and step through the code where you're having issues (both on the web and the behat test at the same time)
That said, if you are doing a Full JS app, you might consider using JS / Mocha / Jasmine tests for testing the frontend instead of Behat if you can just Mock the backend services.