diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php index 44bc551..85f5e9a 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -95,14 +95,14 @@ protected function assertJsCondition($condition, $timeout = 1000, $message = '') * @throws \Behat\Mink\Exception\UnsupportedDriverActionException * When operation not supported by the driver. * @throws \Behat\Mink\Exception\DriverException - * When the operation cannot be done + * When the operation cannot be done. */ protected function createScreenshot($filename, $background = 'white') { - $driver = $this->getSession()->getDriver(); + $session = $this->getSession(); if (!empty($background)) { - $driver->executeScript("document.body.style.backgroundColor = '" . $background . "';"); + $session->executeScript("document.body.style.backgroundColor = '" . $background . "';"); } - $image = $driver->getScreenshot(); + $image = $session->getScreenshot(); file_put_contents($filename, $image); }