Class ReportConsoleMessages
java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.ReportConsoleMessages
- All Implemented Interfaces:
net.serenitybdd.core.SkipNested,net.serenitybdd.screenplay.Performable
Report captured console messages to the Serenity report as evidence.
This interaction attaches console messages to the Serenity report, making them visible in the test results. Use this to include browser console output in your reports for debugging or verification purposes.
Sample usage:
// Capture console messages during the test
actor.attemptsTo(CaptureConsoleMessages.duringTest());
// ... perform actions that may generate console output ...
// Report only errors and warnings to the Serenity report
actor.attemptsTo(ReportConsoleMessages.errorsAndWarnings());
// Or report all messages
actor.attemptsTo(ReportConsoleMessages.all());
// Or report only errors
actor.attemptsTo(ReportConsoleMessages.errors());
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReportConsoleMessagesall()Report all captured console messages to the Serenity report.static ReportConsoleMessageserrors()Report only console errors to the Serenity report.static ReportConsoleMessagesReport console errors and warnings to the Serenity report.<T extends net.serenitybdd.screenplay.Actor>
voidperformAs(T actor) static ReportConsoleMessageswarnings()Report only console warnings to the Serenity report.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.serenitybdd.screenplay.Performable
then
-
Method Details
-
all
Report all captured console messages to the Serenity report. -
errors
Report only console errors to the Serenity report. -
warnings
Report only console warnings to the Serenity report. -
errorsAndWarnings
Report console errors and warnings to the Serenity report. This is the recommended option for most use cases. -
performAs
public <T extends net.serenitybdd.screenplay.Actor> void performAs(T actor) - Specified by:
performAsin interfacenet.serenitybdd.screenplay.Performable
-