File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -132,9 +132,11 @@ def wait_for_downloads(driver):
132132 """
133133 if not driver .current_url .startswith ("chrome://downloads" ):
134134 driver .get ("chrome://downloads/" )
135+ # Chrome changed the `e.state` from a ENUM Str to numbers. Here 2 means COMPLETE.
136+ # Reference: https://github.com/chromium/chromium/blob/b34b8f13054dca8440d2dac0b1b5bae1dc5685d4/chrome/browser/ui/webui/downloads/downloads.mojom#L60
135137 return driver .execute_script ("""
136138 var items = document.querySelector('downloads-manager')
137139 .shadowRoot.getElementById('downloadsList').items;
138- if (items.every(e => e.state === "COMPLETE" ))
140+ if (items.every(e => e.state === 2 ))
139141 return items.map(e => e.fileUrl || e.file_url);
140142 """ )
You can’t perform that action at this time.
0 commit comments