MCPcopy Index your code
hub / github.com/microsoft/playwright-python / expect_request

Method expect_request

tests/server.py:220–231  ·  view source on GitHub ↗
(
        self, path: str
    )

Source from the content-addressed store, hash-verified

218
219 @contextlib.contextmanager
220 def expect_request(
221 self, path: str
222 ) -> Generator[ExpectResponse[TestServerRequest], None, None]:
223 future = asyncio.create_task(self.wait_for_request(path))
224
225 cb_wrapper: ExpectResponse[TestServerRequest] = ExpectResponse()
226
227 def done_cb(task: asyncio.Task) -> None:
228 cb_wrapper._value = future.result()
229
230 future.add_done_callback(done_cb)
231 yield cb_wrapper
232
233 @contextlib.contextmanager
234 def expect_websocket(

Calls 2

wait_for_requestMethod · 0.95
ExpectResponseClass · 0.85