File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ async def _inner_fetch(
412412 self ._timeout_settings .timeout ,
413413 {
414414 "url" : url ,
415+ "timeout" : timeout ,
415416 "params" : object_to_array (params ) if isinstance (params , dict ) else None ,
416417 "encodedParams" : params if isinstance (params , str ) else None ,
417418 "method" : method ,
Original file line number Diff line number Diff line change @@ -89,6 +89,17 @@ async def test_should_support_global_timeout_option(
8989 await request .get (server .EMPTY_PAGE )
9090
9191
92+ async def test_should_support_timeout_option_in_get_method (
93+ playwright : Playwright , server : Server
94+ ) -> None :
95+ request = await playwright .request .new_context ()
96+ server .set_route ("/empty.html" , lambda req : None )
97+ with pytest .raises (
98+ Error , match = "APIRequestContext.get: Request timed out after 123ms"
99+ ):
100+ await request .get (server .EMPTY_PAGE , timeout = 123 )
101+
102+
92103async def test_should_propagate_extra_http_headers_with_redirects (
93104 playwright : Playwright , server : Server
94105) -> None :
Original file line number Diff line number Diff line change @@ -71,6 +71,17 @@ def test_should_support_global_timeout_option(
7171 request .get (server .EMPTY_PAGE )
7272
7373
74+ def test_should_support_timeout_option_in_get_method (
75+ playwright : Playwright , server : Server
76+ ) -> None :
77+ request = playwright .request .new_context ()
78+ server .set_route ("/empty.html" , lambda req : None )
79+ with pytest .raises (
80+ Error , match = "APIRequestContext.get: Request timed out after 123ms"
81+ ):
82+ request .get (server .EMPTY_PAGE , timeout = 123 )
83+
84+
7485def test_should_propagate_extra_http_headers_with_redirects (
7586 playwright : Playwright , server : Server
7687) -> None :
You can’t perform that action at this time.
0 commit comments