java.lang.Object
net.serenitybdd.screenplay.playwright.network.WaitForResponse
All Implemented Interfaces:
net.serenitybdd.core.SkipNested, net.serenitybdd.screenplay.Performable

public class WaitForResponse extends Object implements net.serenitybdd.screenplay.Performable
Wait for a network response matching a pattern while performing an action.

This interaction uses Playwright's waitForResponse which expects an action that triggers the response. Use it with whilePerforming() to specify the action.

  • Method Details

    • matching

      public static WaitForResponse matching(String globPattern)
      Wait for a response where the URL matches the glob pattern.
    • matching

      public static WaitForResponse matching(Pattern pattern)
      Wait for a response where the URL matches the regex pattern.
    • containingUrl

      public static WaitForResponse containingUrl(String substring)
      Wait for a response where the URL contains the substring.
    • whilePerforming

      public WaitForResponse whilePerforming(net.serenitybdd.screenplay.Performable action)
      Specify the action that triggers the response. The action will be performed while waiting for the response.
    • withTimeout

      public WaitForResponse withTimeout(double timeoutMs)
      Set a custom timeout in milliseconds.
    • performAs

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