java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.tracing.StartTracing
All Implemented Interfaces:
net.serenitybdd.core.SkipNested, net.serenitybdd.screenplay.Performable

public class StartTracing extends Object implements net.serenitybdd.screenplay.Performable
Start Playwright tracing to capture screenshots, snapshots, and network activity. Traces can be viewed using the Playwright Trace Viewer.

Sample usage:

     // Start tracing with default options
     actor.attemptsTo(StartTracing.withName("my-test"));

     // Start tracing with all options enabled
     actor.attemptsTo(
         StartTracing.withName("checkout-flow")
             .withScreenshots()
             .withSnapshots()
             .withSources()
     );
 
See Also:
  • Method Details

    • withName

      public static StartTracing withName(String name)
      Start tracing with the given name.
      Parameters:
      name - The name for this trace (used in trace file)
    • withScreenshots

      public StartTracing withScreenshots()
      Enable screenshot capture during tracing.
    • withoutScreenshots

      public StartTracing withoutScreenshots()
      Disable screenshot capture during tracing.
    • withSnapshots

      public StartTracing withSnapshots()
      Enable DOM snapshot capture during tracing.
    • withoutSnapshots

      public StartTracing withoutSnapshots()
      Disable DOM snapshot capture during tracing.
    • withSources

      public StartTracing withSources()
      Enable source code capture in traces.
    • withTitle

      public StartTracing withTitle(String title)
      Set a display title for the trace.
    • performAs

      public <T extends net.serenitybdd.screenplay.Actor> void performAs(T actor)
      Specified by:
      performAs in interface net.serenitybdd.screenplay.Performable