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

public class StopTracing extends Object implements net.serenitybdd.screenplay.Performable
Stop Playwright tracing and save the trace file. The trace can be viewed using the Playwright Trace Viewer: npx playwright show-trace trace.zip

Sample usage:

     // Stop tracing and save to default location
     actor.attemptsTo(StopTracing.andSaveAs("my-trace"));

     // Stop tracing and save to specific path
     actor.attemptsTo(StopTracing.andSaveTo(Paths.get("traces/checkout.zip")));
 
See Also:
  • Method Details

    • andSaveAs

      public static StopTracing andSaveAs(String name)
      Stop tracing and save with the given name to the default traces directory. The file will be saved as: target/playwright/traces/{name}.zip
      Parameters:
      name - The name for the trace file (without extension)
    • andSaveTo

      public static StopTracing andSaveTo(Path path)
      Stop tracing and save to the specified path.
      Parameters:
      path - The full path for the trace file (should end in .zip)
    • andSaveTo

      public static StopTracing andSaveTo(String path)
      Stop tracing and save to the specified path.
      Parameters:
      path - The full path for the trace file (should end in .zip)
    • performAs

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