Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 403]

(no description)

File Size: 295 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

MoodleScreenshotFormatter:: (14 methods):
  __construct()
  getSubscribedEvents()
  getName()
  getDescription()
  getOutputPrinter()
  setParameter()
  getParameter()
  beforeScenario()
  beforeStep()
  afterStep()
  get_run_screenshot_dir()
  take_screenshot()
  take_contentdump()
  get_faildump_filename()


Class: MoodleScreenshotFormatter  - X-Ref

Feature step counter for distributing features between parallel runs.

Use it with --dry-run (and any other selectors combination) to
get the results quickly.

__construct($name, $description, array $parameters, OutputPrinter $printer)   X-Ref
Initializes formatter.

param: string        $name
param: string        $description
param: array         $parameters
param: OutputPrinter $printer

getSubscribedEvents()   X-Ref
Returns an array of event names this subscriber wants to listen to.

return: array The event names to listen to

getName()   X-Ref
Returns formatter name.

return: string

getDescription()   X-Ref
Returns formatter description.

return: string

getOutputPrinter()   X-Ref
Returns formatter output printer.

return: OutputPrinter

setParameter($name, $value)   X-Ref
Sets formatter parameter.

param: string $name
param: mixed  $value

getParameter($name)   X-Ref
Returns parameter name.

param: string $name
return: mixed

beforeScenario(BeforeScenarioTested $event)   X-Ref
Reset currentscenariostepcount

param: BeforeScenarioTested $event

beforeStep(BeforeStepTested $event)   X-Ref
Increment currentscenariostepcount

param: BeforeStepTested $event

afterStep(AfterStepTested $event)   X-Ref
Take screenshot after step is executed.    Behat\Behat\Event\html

param: AfterStepTested $event

get_run_screenshot_dir()   X-Ref
Return screenshot directory where all screenshots will be saved.

return: string

take_screenshot(AfterStepTested $event, $context)   X-Ref
Take screenshot when a step fails.

param: AfterStepTested $event
param: Context $context

take_contentdump(AfterStepTested $event, $context)   X-Ref
Take a dump of the page content when a step fails.

param: AfterStepTested $event
param: \Behat\Context\Context\Context $context

get_faildump_filename(AfterStepTested $event, $filetype)   X-Ref
Determine the full pathname to store a failure-related dump.

This is used for content such as the DOM, and screenshots.

param: AfterStepTested $event
param: String $filetype The file suffix to use. Limited to 4 chars.