Skip to content

Commit

Permalink
fix: relative Firefox record_video_dir (#2141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Oct 30, 2023
1 parent aacb433 commit f30301c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion playwright/_impl/_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
3 changes: 0 additions & 3 deletions playwright/_impl/_browser_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion playwright/_impl/_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 7 additions & 4 deletions playwright/_impl/_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions tests/sync/test_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("<div id=foobar>kek</div>")
expect(page.locator("div#foobar")).to_have_text("kek")
Expand Down

0 comments on commit f30301c

Please sign in to comment.