You are here

public function TestSubContext::afterStepTakeScreenshot in Panopoly 8.2

Same name and namespace in other branches
  1. 7 modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc \TestSubContext::afterStepTakeScreenshot()

After a failed step, upload a screenshot.

@AfterStep

File

modules/panopoly/panopoly_test/behat/steps/panopoly_test.behat.inc, line 382
Provide Behat step-definitions for generic Panopoly tests.

Class

TestSubContext
Behat sub-context for Panopoly.

Code

public function afterStepTakeScreenshot($event) {
  if ($event
    ->getTestResult()
    ->getResultCode() === TestResult::FAILED) {
    $this
      ->takeScreenshot($event
      ->getStep()
      ->getText());
  }
}