Class PlaywrightFailureEvidence
java.lang.Object
net.serenitybdd.screenplay.playwright.evidence.PlaywrightFailureEvidence
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 Summary
Modifier and TypeMethodDescriptionstatic voidcaptureAndAttach(net.serenitybdd.screenplay.Actor actor, com.microsoft.playwright.Page page) Collect and attach failure evidence from the actor's session.getConsoleErrors(net.serenitybdd.screenplay.Actor actor) Get a summary of captured console errors.getFailedRequests(net.serenitybdd.screenplay.Actor actor) Get a summary of failed network requests.
-
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 frompage- The current Playwright page
-
getConsoleErrors
Get a summary of captured console errors.- Parameters:
actor- The actor- Returns:
- List of error message strings
-
getFailedRequests
Get a summary of failed network requests.- Parameters:
actor- The actor- Returns:
- List of failed request descriptions
-