HTML output is being generated twice
Describe the bug When running a test with html output enabled, two html files are generated for each request
To Reproduce Steps to reproduce the behavior:
- Create a test that makes a HTTP request
- Configure html output
- Run the test and see each request is output twice
Expected behavior One HTML file per request
Cause
Core has a guzzle middleware (BrowserHtmlDebugTrait) that auto outputs html files for navigation etc, e.g. clicking a button rather than an explicit ::drupalGet call.
In ::drupalGet it also performs html output if the test driver doesn't support the guzzle middleware, see \Drupal\Tests\UiHelperTrait::isTestUsingGuzzleClient
For DTT, $driver->getClient()
on that line returns an instance of the goutte client whereas core is expecting an instance of DrupalTestBrowser
Proposed resolution
Switch to using DrupalTestBrowser instead of Goutte client OR override \Drupal\Tests\UiHelperTrait::isTestUsingGuzzleClient
in ExisingSiteBase
The later seems simpler