-
-
Save msankhala/31d64fe570626cb77c03c165f5565a8b to your computer and use it in GitHub Desktop.
Debugging Drupal 8 Javascript tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class DebugTest extends YourBrokenTest { | |
/** | |
* Overrides a broken test method and saves HTML at the point of failure. | |
*/ | |
public function testName() { | |
try { | |
parent::testName(); | |
} | |
catch (\Exception $e) { | |
file_put_contents('/Users/me/debug.html', $this->getSession()->getDriver()->getHtml('/html/body')); | |
throw $e; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment