Skip to content

Commit f30301c

Browse files
authored
fix: relative Firefox record_video_dir (#2141)
1 parent aacb433 commit f30301c

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

playwright/_impl/_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ async def prepare_browser_context_params(params: Dict) -> None:
237237
params["recordHar"] = prepare_record_har_options(params)
238238
del params["recordHarPath"]
239239
if "recordVideoDir" in params:
240-
params["recordVideo"] = {"dir": str(params["recordVideoDir"])}
240+
params["recordVideo"] = {"dir": Path(params["recordVideoDir"]).absolute()}
241241
if "recordVideoSize" in params:
242242
params["recordVideo"]["size"] = params["recordVideoSize"]
243243
del params["recordVideoSize"]

playwright/_impl/_browser_context.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,6 @@ async def _inner_close() -> None:
479479
await self._channel.send("close")
480480
await self._closed_future
481481

482-
async def _pause(self) -> None:
483-
await self._channel.send("pause")
484-
485482
async def storage_state(self, path: Union[str, Path] = None) -> StorageState:
486483
result = await self._channel.send_return_as_dict("storageState")
487484
if path:

playwright/_impl/_page.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ async def pause(self) -> None:
961961
try:
962962
await asyncio.wait(
963963
[
964-
asyncio.create_task(self._browser_context._pause()),
964+
asyncio.create_task(self._browser_context._channel.send("pause")),
965965
self._closed_or_crashed_future,
966966
],
967967
return_when=asyncio.FIRST_COMPLETED,

playwright/_impl/_tracing.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def _inner_start() -> str:
5151
"tracingStartChunk", filter_none({"title": title, "name": name})
5252
)
5353

54-
trace_name = await self._connection.wrap_api_call(_inner_start)
54+
trace_name = await self._connection.wrap_api_call(_inner_start, True)
5555
await self._start_collecting_stacks(trace_name)
5656

5757
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:
6868
)
6969

7070
async def stop_chunk(self, path: Union[pathlib.Path, str] = None) -> None:
71-
await self._do_stop_chunk(path)
71+
await self._connection.wrap_api_call(lambda: self._do_stop_chunk(path), True)
7272

7373
async def stop(self, path: Union[pathlib.Path, str] = None) -> None:
74-
await self._do_stop_chunk(path)
75-
await self._channel.send("tracingStop")
74+
async def _inner() -> None:
75+
await self._do_stop_chunk(path)
76+
await self._channel.send("tracingStop")
77+
78+
await self._connection.wrap_api_call(_inner, True)
7679

7780
async def _do_stop_chunk(self, file_path: Union[pathlib.Path, str] = None) -> None:
7881
if self._is_tracing:

tests/sync/test_assertions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,7 @@ def test_to_have_js_property_pass_null(page: Page) -> None:
227227
expect(locator).to_have_js_property("foo", None)
228228

229229

230-
def test_assertions_locator_to_have_text(
231-
page: Page, server: Server
232-
) -> None:
230+
def test_assertions_locator_to_have_text(page: Page, server: Server) -> None:
233231
page.goto(server.EMPTY_PAGE)
234232
page.set_content("<div id=foobar>kek</div>")
235233
expect(page.locator("div#foobar")).to_have_text("kek")

0 commit comments

Comments
 (0)