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

Method expect_websocket

tests/server.py:234–245  ·  view source on GitHub ↗
(
        self,
    )

Source from the content-addressed store, hash-verified

232
233 @contextlib.contextmanager
234 def expect_websocket(
235 self,
236 ) -> Generator[ExpectResponse["WebSocketProtocol"], None, None]:
237 future = self.wait_for_web_socket()
238
239 cb_wrapper: ExpectResponse["WebSocketProtocol"] = ExpectResponse()
240
241 def done_cb(_: asyncio.Future) -> None:
242 cb_wrapper._value = future.result()
243
244 future.add_done_callback(done_cb)
245 yield cb_wrapper
246
247 def set_auth(self, path: str, username: str, password: str) -> None:
248 self.auth[path] = (username, password)

Calls 2

wait_for_web_socketMethod · 0.95
ExpectResponseClass · 0.85

Tested by 4