trait DebugTools (View source)

Step tools to help debug failing steps

Methods

public
void
resetUtilitiesAfterStep(AfterScenarioScope $event)

Ensure utilty steps are reset for subsequent scenarios

public
iTakeAScreenshotAfterEveryStep()

Useful step for working out why a behat testing isn't working when running the browser headless Remove this step from in a feature file once the test is working correct

public
iDumpTheRenderedHtmlAfterEveryStep()

Utility function for debugging failing behat tests Remove this step from in a feature file once the test is working correct

public
takeScreenshotAfterFailedStep(AfterStepScope $event)

Take a screenshot when step fails, or take a screenshot after every step if the use has specified "I take a screenshot after every step" Works only with FacebookWebDriver.

public
void
dumpHtmlAfterStep(AfterStepScope $event)

Dump HTML when step fails.

public
dumpRenderedHtml(StepScope $event)

Dump rendered HTML to disk Useful for seeing the state of a page when writing and debugging feature files

public
takeScreenshot(StepScope $event)

Take a nice screenshot

Details

void resetUtilitiesAfterStep(AfterScenarioScope $event)

Ensure utilty steps are reset for subsequent scenarios

Parameters

AfterScenarioScope $event

Return Value

void

iTakeAScreenshotAfterEveryStep()

Useful step for working out why a behat testing isn't working when running the browser headless Remove this step from in a feature file once the test is working correct

iDumpTheRenderedHtmlAfterEveryStep()

Utility function for debugging failing behat tests Remove this step from in a feature file once the test is working correct

takeScreenshotAfterFailedStep(AfterStepScope $event)

Take a screenshot when step fails, or take a screenshot after every step if the use has specified "I take a screenshot after every step" Works only with FacebookWebDriver.

Parameters

AfterStepScope $event

void dumpHtmlAfterStep(AfterStepScope $event)

Dump HTML when step fails.

Parameters

AfterStepScope $event

Return Value

void

dumpRenderedHtml(StepScope $event)

Dump rendered HTML to disk Useful for seeing the state of a page when writing and debugging feature files

Parameters

StepScope $event

takeScreenshot(StepScope $event)

Take a nice screenshot

Parameters

StepScope $event