expect
Expects a request to match the given urlPattern.
For example, capturing the response body of a specific API call can be done like this:
val responseBody = tab.expect(Regex("https://api.example.com/data")) {
tab.get("https://example.com")
getResponseBody<UserData>()
}
Content copied to clipboard
Parameters
urlPattern
The regex pattern to match the request URL.
block
The block to execute during which the expectation is active.