You are here

public function BrowserWithJavascriptTest::testCreateScreenshot in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php \Drupal\FunctionalJavascriptTests\BrowserWithJavascriptTest::testCreateScreenshot()
  2. 10 core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php \Drupal\FunctionalJavascriptTests\BrowserWithJavascriptTest::testCreateScreenshot()

Tests creating screenshots.

File

core/tests/Drupal/FunctionalJavascriptTests/BrowserWithJavascriptTest.php, line 72

Class

BrowserWithJavascriptTest
Tests if we can execute JavaScript in the browser.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function testCreateScreenshot() {
  $this
    ->drupalGet('<front>');
  $this
    ->createScreenshot('public://screenshot.jpg');
  $this
    ->assertFileExists('public://screenshot.jpg');
}