Created
May 18, 2016 17:49
-
-
Save mortenson/33809985b838571ddd199b40d84ab2b2 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