Class PlaywrightStepListener

java.lang.Object
net.serenitybdd.playwright.PlaywrightStepListener
All Implemented Interfaces:
net.thucydides.model.steps.StepListener

public class PlaywrightStepListener extends Object implements net.thucydides.model.steps.StepListener
Listens to step events and captures Playwright screenshots.

This listener integrates with Serenity's step event system to automatically capture screenshots at step boundaries for all registered Playwright pages.

  • Constructor Details

    • PlaywrightStepListener

      public PlaywrightStepListener()
  • Method Details

    • takeScreenshotNow

      public void takeScreenshotNow()
      Manually trigger screenshot capture for all registered pages.
    • stepFinished

      public void stepFinished()
      Specified by:
      stepFinished in interface net.thucydides.model.steps.StepListener
    • stepFinished

      public void stepFinished(List<net.thucydides.model.screenshots.ScreenshotAndHtmlSource> screenshotList, ZonedDateTime time)
      Specified by:
      stepFinished in interface net.thucydides.model.steps.StepListener
    • stepFailed

      public void stepFailed(net.thucydides.model.steps.StepFailure failure)
      Specified by:
      stepFailed in interface net.thucydides.model.steps.StepListener
    • stepFailed

      public void stepFailed(net.thucydides.model.steps.StepFailure failure, List<net.thucydides.model.screenshots.ScreenshotAndHtmlSource> screenshotList, boolean isInDataDrivenTest, ZonedDateTime timestamp)
      Specified by:
      stepFailed in interface net.thucydides.model.steps.StepListener
    • testSuiteStarted

      public void testSuiteStarted(Class<?> storyClass)
      Specified by:
      testSuiteStarted in interface net.thucydides.model.steps.StepListener
    • testSuiteStarted

      public void testSuiteStarted(net.thucydides.model.domain.Story story)
      Specified by:
      testSuiteStarted in interface net.thucydides.model.steps.StepListener
    • testSuiteFinished

      public void testSuiteFinished()
      Specified by:
      testSuiteFinished in interface net.thucydides.model.steps.StepListener
    • testStarted

      public void testStarted(String description)
      Specified by:
      testStarted in interface net.thucydides.model.steps.StepListener
    • testStarted

      public void testStarted(String description, String id)
      Specified by:
      testStarted in interface net.thucydides.model.steps.StepListener
    • testStarted

      public void testStarted(String description, String id, ZonedDateTime startTime)
      Specified by:
      testStarted in interface net.thucydides.model.steps.StepListener
    • testFinished

      public void testFinished(net.thucydides.model.domain.TestOutcome result)
      Specified by:
      testFinished in interface net.thucydides.model.steps.StepListener
    • testFinished

      public void testFinished(net.thucydides.model.domain.TestOutcome result, boolean isInDataDrivenTest, ZonedDateTime finishTime)
      Specified by:
      testFinished in interface net.thucydides.model.steps.StepListener
    • testRetried

      public void testRetried()
      Specified by:
      testRetried in interface net.thucydides.model.steps.StepListener
    • stepStarted

      public void stepStarted(net.thucydides.model.steps.ExecutedStepDescription description)
      Specified by:
      stepStarted in interface net.thucydides.model.steps.StepListener
    • skippedStepStarted

      public void skippedStepStarted(net.thucydides.model.steps.ExecutedStepDescription description)
      Specified by:
      skippedStepStarted in interface net.thucydides.model.steps.StepListener
    • lastStepFailed

      public void lastStepFailed(net.thucydides.model.steps.StepFailure failure)
      Specified by:
      lastStepFailed in interface net.thucydides.model.steps.StepListener
    • stepIgnored

      public void stepIgnored()
      Specified by:
      stepIgnored in interface net.thucydides.model.steps.StepListener
    • stepPending

      public void stepPending()
      Specified by:
      stepPending in interface net.thucydides.model.steps.StepListener
    • stepPending

      public void stepPending(String message)
      Specified by:
      stepPending in interface net.thucydides.model.steps.StepListener
    • testFailed

      public void testFailed(net.thucydides.model.domain.TestOutcome testOutcome, Throwable cause)
      Specified by:
      testFailed in interface net.thucydides.model.steps.StepListener
    • testIgnored

      public void testIgnored()
      Specified by:
      testIgnored in interface net.thucydides.model.steps.StepListener
    • testSkipped

      public void testSkipped()
      Specified by:
      testSkipped in interface net.thucydides.model.steps.StepListener
    • testPending

      public void testPending()
      Specified by:
      testPending in interface net.thucydides.model.steps.StepListener
    • testIsManual

      public void testIsManual()
      Specified by:
      testIsManual in interface net.thucydides.model.steps.StepListener
    • notifyScreenChange

      public void notifyScreenChange()
      Specified by:
      notifyScreenChange in interface net.thucydides.model.steps.StepListener
    • useExamplesFrom

      public void useExamplesFrom(net.thucydides.model.domain.DataTable table)
      Specified by:
      useExamplesFrom in interface net.thucydides.model.steps.StepListener
    • addNewExamplesFrom

      public void addNewExamplesFrom(net.thucydides.model.domain.DataTable table)
      Specified by:
      addNewExamplesFrom in interface net.thucydides.model.steps.StepListener
    • exampleStarted

      public void exampleStarted(Map<String,String> data)
      Specified by:
      exampleStarted in interface net.thucydides.model.steps.StepListener
    • exampleFinished

      public void exampleFinished()
      Specified by:
      exampleFinished in interface net.thucydides.model.steps.StepListener
    • assumptionViolated

      public void assumptionViolated(String message)
      Specified by:
      assumptionViolated in interface net.thucydides.model.steps.StepListener
    • testRunFinished

      public void testRunFinished()
      Specified by:
      testRunFinished in interface net.thucydides.model.steps.StepListener
    • takeScreenshots

      public void takeScreenshots(List<net.thucydides.model.screenshots.ScreenshotAndHtmlSource> screenshots)
      Specified by:
      takeScreenshots in interface net.thucydides.model.steps.StepListener
    • takeScreenshots

      public void takeScreenshots(net.thucydides.model.domain.TestResult testResult, List<net.thucydides.model.screenshots.ScreenshotAndHtmlSource> screenshots)
      Specified by:
      takeScreenshots in interface net.thucydides.model.steps.StepListener
    • recordScreenshot

      public void recordScreenshot(String screenshotName, byte[] screenshot)
      Specified by:
      recordScreenshot in interface net.thucydides.model.steps.StepListener