java.lang.Object
net.serenitybdd.screenplay.playwright.evidence.PlaywrightFailureEvidence

public class PlaywrightFailureEvidence extends Object
Collects and attaches failure evidence to Serenity reports.

This class gathers diagnostic information when a test fails:

  • Console errors and warnings
  • Failed network requests (4xx, 5xx, network errors)
  • Current page URL and title

Evidence is automatically attached to the Serenity report for debugging.

  • Method Details

    • captureAndAttach

      public static void captureAndAttach(net.serenitybdd.screenplay.Actor actor, com.microsoft.playwright.Page page)
      Collect and attach failure evidence from the actor's session.
      Parameters:
      actor - The actor whose session to collect evidence from
      page - The current Playwright page
    • getConsoleErrors

      public static List<String> getConsoleErrors(net.serenitybdd.screenplay.Actor actor)
      Get a summary of captured console errors.
      Parameters:
      actor - The actor
      Returns:
      List of error message strings
    • getFailedRequests

      public static List<String> getFailedRequests(net.serenitybdd.screenplay.Actor actor)
      Get a summary of failed network requests.
      Parameters:
      actor - The actor
      Returns:
      List of failed request descriptions