Skip to content

Commit 4396e5c

Browse files
authored
Merge pull request #115 from hhslepicka/mnt/remove-numpy-lock
2 parents 4782d22 + 6a7152a commit 4396e5c

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

botcity/web/browsers/chrome.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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://shorturl.at/G4EES
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
""")

botcity/web/browsers/undetected_chrome.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ def wait_for_downloads(driver):
138138
"""
139139
if not driver.current_url.startswith("chrome://downloads"):
140140
driver.get("chrome://downloads/")
141+
# Chrome changed the `e.state` from a ENUM Str to numbers. Here 2 means COMPLETE.
142+
# Reference: https://shorturl.at/G4EES
141143
return driver.execute_script("""
142144
var items = document.querySelector('downloads-manager')
143145
.shadowRoot.getElementById('downloadsList').items;
144-
if (items.every(e => e.state === "COMPLETE"))
146+
if (items.every(e => e.state === 2))
145147
return items.map(e => e.fileUrl || e.file_url);
146148
""")

botcity/web/tests/__init__.py

Whitespace-only changes.

botcity/web/tests/test_import.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
botcity-framework-base>=0.2.2
22
beautifulsoup4
3-
numpy<2
3+
numpy
44
opencv-python
55
pillow
66
selenium>=4.10,<5
77
undetected-chromedriver
8-
packaging
8+
packaging

tests/test_browser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def test_get_view_port_size(web: WebBot):
215215
element = [width, height]
216216
else:
217217
element = web.find_element('window-size', By.ID).text.split('x')
218-
sizes = [tuple(int(e) for e in element), (1600, 900), (1176, 802)]
218+
sizes = [tuple(int(e) for e in element), (1600, 900), (1176, 802), (1600, 987)]
219219
assert size in sizes
220220

221221

0 commit comments

Comments
 (0)