You are here

public function DebugContext::saveScreenshot in Lightning Core 8.5

Same name and namespace in other branches
  1. 8.2 tests/contexts/DebugContext.behat.inc \Acquia\LightningExtension\Context\DebugContext::saveScreenshot()
  2. 8.3 tests/contexts/DebugContext.behat.inc \Acquia\LightningExtension\Context\DebugContext::saveScreenshot()
  3. 8.4 tests/contexts/DebugContext.behat.inc \Acquia\LightningExtension\Context\DebugContext::saveScreenshot()

Takes a screenshot.

@When I take a screenshot

Parameters

string $filename: (optional) Ignored. The filename is based on a counter and prefixed with the name of the Mink browser.

mixed $filepath: (optional) Ignored. The screenshot is saved in the directory above the Drupal root.

File

tests/contexts/DebugContext.behat.inc, line 58

Class

DebugContext
Contains step definitions to assist with debugging tests.

Namespace

Acquia\LightningExtension\Context

Code

public function saveScreenshot($filename = NULL, $filepath = NULL) {
  $filename = sprintf('%s_%d.png', $this
    ->getMinkParameter('browser_name'), ++$this->screenshotCount);
  $filepath = \Drupal::root() . '/../';
  parent::saveScreenshot($filename, $filepath);
}