diff --git a/playwright/_impl/_browser.py b/playwright/_impl/_browser.py index 79ed408bd..2649d75ea 100644 --- a/playwright/_impl/_browser.py +++ b/playwright/_impl/_browser.py @@ -237,7 +237,7 @@ async def prepare_browser_context_params(params: Dict) -> None: params["recordHar"] = prepare_record_har_options(params) del params["recordHarPath"] if "recordVideoDir" in params: - params["recordVideo"] = {"dir": str(params["recordVideoDir"])} + params["recordVideo"] = {"dir": Path(params["recordVideoDir"]).absolute()} if "recordVideoSize" in params: params["recordVideo"]["size"] = params["recordVideoSize"] del params["recordVideoSize"] diff --git a/playwright/_impl/_browser_context.py b/playwright/_impl/_browser_context.py index 1c7c546fe..6681e0852 100644 --- a/playwright/_impl/_browser_context.py +++ b/playwright/_impl/_browser_context.py @@ -479,9 +479,6 @@ async def _inner_close() -> None: await self._channel.send("close") await self._closed_future - async def _pause(self) -> None: - await self._channel.send("pause") - async def storage_state(self, path: Union[str, Path] = None) -> StorageState: result = await self._channel.send_return_as_dict("storageState") if path: diff --git a/playwright/_impl/_page.py b/playwright/_impl/_page.py index be2538689..99944be41 100644 --- a/playwright/_impl/_page.py +++ b/playwright/_impl/_page.py @@ -961,7 +961,7 @@ async def pause(self) -> None: try: await asyncio.wait( [ - asyncio.create_task(self._browser_context._pause()), + asyncio.create_task(self._browser_context._channel.send("pause")), self._closed_or_crashed_future, ], return_when=asyncio.FIRST_COMPLETED, diff --git a/playwright/_impl/_tracing.py b/playwright/_impl/_tracing.py index 509bbe336..98f19cb69 100644 --- a/playwright/_impl/_tracing.py +++ b/playwright/_impl/_tracing.py @@ -51,7 +51,7 @@ async def _inner_start() -> str: "tracingStartChunk", filter_none({"title": title, "name": name}) ) - trace_name = await self._connection.wrap_api_call(_inner_start) + trace_name = await self._connection.wrap_api_call(_inner_start, True) await self._start_collecting_stacks(trace_name) async def start_chunk(self, title: str = None, name: str = None) -> None: @@ -68,11 +68,14 @@ async def _start_collecting_stacks(self, trace_name: str) -> None: ) async def stop_chunk(self, path: Union[pathlib.Path, str] = None) -> None: - await self._do_stop_chunk(path) + await self._connection.wrap_api_call(lambda: self._do_stop_chunk(path), True) async def stop(self, path: Union[pathlib.Path, str] = None) -> None: - await self._do_stop_chunk(path) - await self._channel.send("tracingStop") + async def _inner() -> None: + await self._do_stop_chunk(path) + await self._channel.send("tracingStop") + + await self._connection.wrap_api_call(_inner, True) async def _do_stop_chunk(self, file_path: Union[pathlib.Path, str] = None) -> None: if self._is_tracing: diff --git a/tests/sync/test_assertions.py b/tests/sync/test_assertions.py index e11afe6f2..3f83eec49 100644 --- a/tests/sync/test_assertions.py +++ b/tests/sync/test_assertions.py @@ -227,9 +227,7 @@ def test_to_have_js_property_pass_null(page: Page) -> None: expect(locator).to_have_js_property("foo", None) -def test_assertions_locator_to_have_text( - page: Page, server: Server -) -> None: +def test_assertions_locator_to_have_text(page: Page, server: Server) -> None: page.goto(server.EMPTY_PAGE) page.set_content("