Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Selenium 4, add ignores for alerts 63066, 63227 #7100

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ safety: ## Run `safety check` to check python dependencies for vulnerabilities.
--ignore 61893 \
--ignore 62019 \
--ignore 62044 \
--ignore 63066 \
--ignore 63227 \
--full-report -r $$req_file \
&& echo -e '\n' \
|| exit 1; \
Expand Down
4 changes: 2 additions & 2 deletions securedrop/requirements/python3/test-requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pytest-cov
pytest-mock
requests[socks]>=2.31.0
setuptools>=56.0.0
selenium>=3.141.0
tbselenium>=0.5.2
selenium>4.15.1
tbselenium>=0.8.1
pyvirtualdisplay
urllib3>=1.26.5
# mypy and co.
Expand Down
64 changes: 53 additions & 11 deletions securedrop/requirements/python3/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ apipkg==1.5 \
attrs==22.1.0 \
--hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \
--hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c
# via pytest
# via
# outcome
# pytest
# trio
beautifulsoup4==4.6.0 \
--hash=sha256:11a9a27b7d3bddc6d86f59fb76afb70e921a25ac2d6cc55b40d072bd68435a76 \
--hash=sha256:7015e76bf32f1f574636c4288399a6de66ce08fb7b2457f628a8d70c0fbabb11 \
Expand All @@ -23,7 +26,9 @@ blinker==1.4 \
certifi==2023.7.22 \
--hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \
--hash=sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9
# via requests
# via
# requests
# selenium
charset-normalizer==2.0.3 \
--hash=sha256:88fce3fa5b1a84fdcb3f603d889f723d1dd89b26059d0123ca435570e848d5e1 \
--hash=sha256:c46c3ace2d744cfbdebceaa3c19ae691f53ae621b39fd7570f59d14fb7f2fd12
Expand Down Expand Up @@ -76,7 +81,10 @@ easyprocess==0.2.3 \
exceptiongroup==1.0.4 \
--hash=sha256:542adf9dea4055530d6e1279602fa5cb11dab2395fa650b8674eaec35fc4a828 \
--hash=sha256:bd14967b79cd9bdb54d97323216f8fdf533e278df937aa2a90089e7d6e06e5ec
# via pytest
# via
# pytest
# trio
# trio-websocket
execnet==1.7.1 \
--hash=sha256:cacb9df31c9680ec5f95553976c4da484d407e85e41c83cb812aa014f0eddc50 \
--hash=sha256:d4efd397930c46415f62f8a31388d6be4f27a91d7550eb79bc64a756e0056547
Expand All @@ -85,13 +93,19 @@ flaky==3.6.0 \
--hash=sha256:36fa125bceebfe869739b62e203db4653488dff09615e5a4f3d7607d48363c6a \
--hash=sha256:c24e321b3b4b4a2d323b646acff6738e7601849832f4280864d69f00a6a9869d
# via -r requirements/python3/test-requirements.in
h11==0.14.0 \
--hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \
--hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761
# via wsproto
html5validator==0.4.0 \
--hash=sha256:3ce6e3e736c9c7b37e5e26eb173ba0777ae00776549bd608933fa14955260d49
# via -r requirements/python3/test-requirements.in
idna==2.8 \
--hash=sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407 \
--hash=sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c
# via requests
# via
# requests
# trio
iniconfig==1.0.1 \
--hash=sha256:80cf40c597eb564e86346103f609d74efce0f6b4d4f30ec8ce9e2c26411ba437 \
--hash=sha256:e5f92f89355a67de0595932a6c6c02ab4afddc6fcdc0bfc5becd0d60884d3f69
Expand Down Expand Up @@ -134,6 +148,10 @@ mypy==1.0.0 \
# via
# -r requirements/python3/test-requirements.in
# sqlalchemy-stubs
outcome==1.3.0.post0 \
--hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \
--hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b
# via trio
packaging==20.4 \
--hash=sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8 \
--hash=sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181
Expand Down Expand Up @@ -222,7 +240,9 @@ pyparsing==2.4.7 \
# via packaging
pysocks==1.6.8 \
--hash=sha256:3fe52c55890a248676fd69dc9e3c4e811718b777834bcaab7a8125cf9deac672
# via requests
# via
# requests
# urllib3
pytest-cov==2.5.1 \
--hash=sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d \
--hash=sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec
Expand Down Expand Up @@ -281,9 +301,9 @@ requests[socks]==2.31.0 \
--hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
# via -r requirements/python3/test-requirements.in
selenium==3.141.0 \
--hash=sha256:2d7131d7bc5a5b99a2d9b04aaf2612c411b03b8ca1b1ee8d3de5845a9be2cb3c \
--hash=sha256:deaf32b60ad91a4611b98d8002757f29e6f2c2d5fcaf202e1c9ad06d6772300d
selenium==4.16.0 \
--hash=sha256:aec71f4e6ed6cb3ec25c9c1b5ed56ae31b6da0a7f17474c7566d303f84e6219f \
--hash=sha256:b2e987a445306151f7be0e6dfe2aa72a479c2ac6a91b9d5ef2d6dd4e49ad0435
# via
# -r requirements/python3/test-requirements.in
# tbselenium
Expand All @@ -294,12 +314,20 @@ six==1.11.0 \
# mock
# packaging
# pathlib2
sniffio==1.3.0 \
--hash=sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101 \
--hash=sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384
# via trio
sortedcontainers==2.4.0 \
--hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \
--hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0
# via trio
sqlalchemy-stubs==0.4 \
--hash=sha256:5eec7aa110adf9b957b631799a72fef396b23ff99fe296df726645d01e312aa5 \
--hash=sha256:c665d6dd4482ef642f01027fa06c3d5e91befabb219dc71fc2a09e7d7695f7ae
# via -r requirements/python3/test-requirements.in
tbselenium==0.5.2 \
--hash=sha256:84dcc3f250b0c6bb4ce4bdb0d62de1d086343334019accb5469c21897afebb06
tbselenium==0.8.1 \
--hash=sha256:b40df4f339459d90e8c9e6fd66f7ebf9baabbc5b79d8ca7c94ebcb092f7e1726
# via -r requirements/python3/test-requirements.in
toml==0.10.1 \
--hash=sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f \
Expand All @@ -311,6 +339,16 @@ tomli==2.0.1 \
# via
# mypy
# pytest
trio-websocket==0.11.1 \
--hash=sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f \
--hash=sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638
# via selenium
trio==0.23.2 \
--hash=sha256:5a0b566fa5d50cf231cfd6b08f3b03aa4179ff004b8f3144059587039e2b26d3 \
--hash=sha256:da1d35b9a2b17eb32cae2e763b16551f9aa6703634735024e32f325c9285069e
# via
# selenium
# trio-websocket
types-mock==4.0.12 \
--hash=sha256:81f98e66bddde1b2a8d96c15c084d5d3ed96cf6137bca9ba8aabc6b6865b9ca7 \
--hash=sha256:f8b1dbe128dc2d5aa038876a8b497dfd1a9405210a5eb3dc4b4757c2e254627c
Expand Down Expand Up @@ -341,13 +379,17 @@ typing-extensions==4.1.1 \
# via
# mypy
# sqlalchemy-stubs
urllib3==1.26.6 \
urllib3[socks]==1.26.6 \
--hash=sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4 \
--hash=sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f
# via
# -r requirements/python3/test-requirements.in
# requests
# selenium
wsproto==1.2.0 \
--hash=sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065 \
--hash=sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736
# via trio-websocket

# The following packages are considered to be unsafe in a requirements file:
pip==21.1.1 \
Expand Down
3 changes: 1 addition & 2 deletions securedrop/tests/functional/app_navigators/_nav_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class NavigationHelper:

_TIMEOUT = 10
_POLL_FREQUENCY = 0.1

Expand Down Expand Up @@ -76,7 +75,7 @@ def safe_click_all_by_css_selector(self, selector: str) -> List[WebElement]:
selenium.common.exceptions.TimeoutException: If the element cannot be found in time.

"""
els = self.wait_for(lambda: self.driver.find_elements_by_css_selector(selector))
els = self.wait_for(lambda: self.driver.find_elements(By.CSS_SELECTOR, selector))
for el in els:
clickable_el = WebDriverWait(self.driver, self._TIMEOUT, self._POLL_FREQUENCY).until(
expected_conditions.element_to_be_clickable((By.CSS_SELECTOR, selector))
Expand Down
Loading
Loading