module Playwright::Route
Overview
Whenever a network route is set up with page.route(url, handler)
or browserContext.route(url, handler)
, the Route
object allows to handle the route.
Defined in:
playwright/route.crInstance Method Summary
-
#abort(error_code : String | Nil) : Nil
Aborts the route's request.
- #abort : Nil
-
#continue(overrides : ContinueOverrides | Nil) : Nil
Continues route's request with optional overrides.
- #continue : Nil
-
#fulfill(response : FulfillResponse) : Nil
Fulfills route's request with given response.
-
#request : Request
A request to be routed.
Instance Method Detail
abstract
def continue(overrides : ContinueOverrides | Nil) : Nil
#
Continues route's request with optional overrides.
abstract
def fulfill(response : FulfillResponse) : Nil
#
Fulfills route's request with given response. An example of fulfilling all requests with 404 responses:
An example of serving static file: