Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playwright/_impl/_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def path(self) -> pathlib.Path:
)
if not self._artifact:
raise Error("Video recording has not been started.")
return self._artifact.absolute_path
return pathlib.Path(self._artifact.absolute_path)

async def save_as(self, path: Union[str, pathlib.Path]) -> None:
if self._page._connection._is_sync and not self._page._is_closed:
Expand Down
1 change: 1 addition & 0 deletions tests/async/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ async def test_should_expose_video_path(
await page.goto(server.PREFIX + "/grid.html")
assert page.video
path = await page.video.path()
assert isinstance(path, Path)
assert str(tmp_path) in str(path)
await page.context.close()

Expand Down
1 change: 1 addition & 0 deletions tests/sync/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def test_should_expose_video_path(
video = page.video
assert video
path = video.path()
assert isinstance(path, Path)
assert repr(page.video) == f"<Video page={page}>"
assert str(tmp_path) in str(path)
page.wait_for_timeout(1000)
Expand Down