File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Fixed
11
11
12
12
- Fix for calls to ` evaluate ` that return JSON: only set ` serialization_options ` when ` return_by_value=False ` @thromer
13
+ - Fix download_path error in ` DownloadExpectation ` (https://github.com/cdpdriver/zendriver/issues/184 ) @MadsHangaard
13
14
14
15
### Added
15
16
Original file line number Diff line number Diff line change @@ -202,6 +202,11 @@ def __init__(self, tab: Connection):
202
202
self .default_behavior = (
203
203
self .tab ._download_behavior [0 ] if self .tab ._download_behavior else "default"
204
204
)
205
+ self .download_path = (
206
+ self .tab ._download_behavior [1 ]
207
+ if self .tab ._download_behavior and len (self .tab ._download_behavior ) > 1
208
+ else None
209
+ )
205
210
206
211
async def _handler (self , event : cdp .browser .DownloadWillBegin ) -> None :
207
212
self ._remove_handler ()
@@ -225,7 +230,9 @@ async def __aexit__(self, *args: Any) -> None:
225
230
Exit the context manager, removing handler, set download behavior to default.
226
231
"""
227
232
await self .tab .send (
228
- cdp .browser .set_download_behavior (behavior = self .default_behavior )
233
+ cdp .browser .set_download_behavior (
234
+ behavior = self .default_behavior , download_path = self .download_path
235
+ )
229
236
)
230
237
self ._remove_handler ()
231
238
You can’t perform that action at this time.
0 commit comments