Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter Class Reference
Inheritance diagram for Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter:

Public Member Functions

 __construct ($name, $description, array $parameters, OutputPrinter $printer)
 Initializes formatter.
 
 afterStep (AfterStepTested $event)
 Take screenshot after step is executed.
 
 beforeScenario (BeforeScenarioTested $event)
 Reset currentscenariostepcount.
 
 beforeStep (BeforeStepTested $event)
 Increment currentscenariostepcount.
 
 getDescription ()
 Returns formatter description.
 
 getName ()
 Returns formatter name.
 
 getOutputPrinter ()
 Returns formatter output printer.
 
 getParameter ($name)
 Returns parameter name.
 
 setParameter ($name, $value)
 Sets formatter parameter.
 

Static Public Member Functions

static getSubscribedEvents ()
 Returns an array of event names this subscriber wants to listen to.
 

Protected Member Functions

 get_faildump_filename (AfterStepTested $event, $filetype)
 Determine the full pathname to store a failure-related dump.
 
 get_run_screenshot_dir ()
 Return screenshot directory where all screenshots will be saved.
 
 take_contentdump (AfterStepTested $event, $context)
 Take a dump of the page content when a step fails.
 
 take_screenshot (AfterStepTested $event, $context)
 Take screenshot when a step fails.
 

Static Protected Attributes

static int $currentscenariocount = 0
 The scenario count.
 
static int $currentscenariostepcount = 0
 The step count within the current scenario.
 
static The $faildumpdirname = false
 If we are saving any kind of dump on failure we should use the same parent dir during a run.
 

Constructor & Destructor Documentation

◆ __construct()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::__construct ( $name,
$description,
array $parameters,
OutputPrinter $printer )

Initializes formatter.

Parameters
string$name
string$description
array$parameters
OutputPrinter$printer

Member Function Documentation

◆ afterStep()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::afterStep ( AfterStepTested $event)

Take screenshot after step is executed.

Behat\Behat\Event\html

Parameters
AfterStepTested$event

◆ beforeScenario()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::beforeScenario ( BeforeScenarioTested $event)

Reset currentscenariostepcount.

Parameters
BeforeScenarioTested$event

◆ beforeStep()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::beforeStep ( BeforeStepTested $event)

Increment currentscenariostepcount.

Parameters
BeforeStepTested$event

◆ get_faildump_filename()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::get_faildump_filename ( AfterStepTested $event,
$filetype )
protected

Determine the full pathname to store a failure-related dump.

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

Parameters
AfterStepTested$event
String$filetypeThe file suffix to use. Limited to 4 chars.

◆ get_run_screenshot_dir()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::get_run_screenshot_dir ( )
protected

Return screenshot directory where all screenshots will be saved.

Return values
string

◆ getDescription()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::getDescription ( )

Returns formatter description.

Return values
string

◆ getName()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::getName ( )

Returns formatter name.

Return values
string

◆ getOutputPrinter()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::getOutputPrinter ( )

Returns formatter output printer.

Return values
OutputPrinter

◆ getParameter()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::getParameter ( $name)

Returns parameter name.

Parameters
string$name
Return values
mixed

◆ getSubscribedEvents()

static Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::getSubscribedEvents ( )
static

Returns an array of event names this subscriber wants to listen to.

Return values
arrayThe event names to listen to

◆ setParameter()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::setParameter ( $name,
$value )

Sets formatter parameter.

Parameters
string$name
mixed$value

◆ take_contentdump()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::take_contentdump ( AfterStepTested $event,
$context )
protected

Take a dump of the page content when a step fails.

Exceptions
Exception
Parameters
AfterStepTested$event
Behat\Context\Context\Context$context

◆ take_screenshot()

Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::take_screenshot ( AfterStepTested $event,
$context )
protected

Take screenshot when a step fails.

Exceptions
Exception
Parameters
AfterStepTested$event
Context$context

Member Data Documentation

◆ $faildumpdirname

The Moodle\BehatExtension\Output\Formatter\MoodleScreenshotFormatter::$faildumpdirname = false
staticprotected

If we are saving any kind of dump on failure we should use the same parent dir during a run.

parent dir name


The documentation for this class was generated from the following file: