File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616from pathlib import Path
1717from typing import Dict
1818
19- import pytest
20-
21- from playwright .sync_api import Browser , BrowserType , Error
19+ from playwright .sync_api import Browser , BrowserType
2220from tests .server import Server
2321
2422
@@ -93,23 +91,3 @@ def test_record_video_can_get_video_path_immediately(
9391 page .wait_for_timeout (1000 )
9492 context .close ()
9593 assert os .path .exists (path )
96-
97-
98- def test_should_error_if_page_not_closed_before_save_as (
99- browser : Browser , tmp_path : Path , server : Server
100- ) -> None :
101- page = browser .new_page (record_video_dir = tmp_path )
102- page .goto (server .PREFIX + "/grid.html" )
103- page .wait_for_timeout (1000 ) # Give it some time to record.
104- out_path = tmp_path / "some-video.webm"
105- with pytest .raises (Error ) as err :
106- video = page .video
107- assert video
108- video .save_as (out_path )
109- assert video
110- assert "Page is not yet closed. Close the page prior to calling save_as" in str (err )
111- assert not os .path .exists (out_path )
112- page .close ()
113-
114- video .save_as (out_path )
115- assert os .path .exists (out_path )
You can’t perform that action at this time.
0 commit comments