MAINT Update to selenium 4.0.0.b3 (#1422)

This commit is contained in:
Roman Yurchak 2021-04-19 13:39:22 +02:00 committed by GitHub
parent 025e295470
commit 5a2f7d027f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 44 deletions

View File

@ -3,7 +3,7 @@ version: 2
defaults: &defaults defaults: &defaults
working_directory: ~/repo working_directory: ~/repo
docker: docker:
- image: pyodide/pyodide-env:14 - image: pyodide/pyodide-env:15
environment: environment:
- EMSDK_NUM_CORES: 4 - EMSDK_NUM_CORES: 4
EMCC_CORES: 4 EMCC_CORES: 4

View File

@ -23,7 +23,7 @@ RUN pip3 --no-cache-dir install \
pytest-rerunfailures \ pytest-rerunfailures \
pytest-xdist \ pytest-xdist \
pyyaml \ pyyaml \
"selenium~=3.141.0" "selenium==4.0.0.b3"
# Get firefox 70.0.1 and geckodriver # Get firefox 70.0.1 and geckodriver
RUN wget -qO- https://ftp.mozilla.org/pub/firefox/releases/87.0/linux-x86_64/en-US/firefox-87.0.tar.bz2 | tar jx \ RUN wget -qO- https://ftp.mozilla.org/pub/firefox/releases/87.0/linux-x86_64/en-US/firefox-87.0.tar.bz2 | tar jx \

View File

@ -21,24 +21,9 @@ BUILD_PATH = ROOT_PATH / "build"
sys.path.append(str(ROOT_PATH)) sys.path.append(str(ROOT_PATH))
from pyodide_build._fixes import _selenium_is_connectable # noqa: E402
from pyodide_build.testing import set_webdriver_script_timeout, parse_driver_timeout from pyodide_build.testing import set_webdriver_script_timeout, parse_driver_timeout
def _monkeypatch_selenium():
try:
import selenium.webdriver.common.utils # noqa: E402
# XXX: Temporary fix for ConnectionError in selenium
selenium.webdriver.common.utils.is_connectable = _selenium_is_connectable
except ModuleNotFoundError:
pass
_monkeypatch_selenium()
def pytest_addoption(parser): def pytest_addoption(parser):
group = parser.getgroup("general") group = parser.getgroup("general")
group.addoption( group.addoption(
@ -55,9 +40,11 @@ def pytest_addoption(parser):
def pytest_configure(config): def pytest_configure(config):
"""Monkey patch the function cwd_relative_nodeid returns the description """Monkey patch the function cwd_relative_nodeid
of a test for the short summary table. Monkey patch it to reduce the verbosity of the test names in the table.
This leaves enough room to see the information about the test failure in the summary. returns the description of a test for the short summary table. Monkey patch
it to reduce the verbosity of the test names in the table. This leaves
enough room to see the information about the test failure in the summary.
""" """
old_cwd_relative_nodeid = config.cwd_relative_nodeid old_cwd_relative_nodeid = config.cwd_relative_nodeid

View File

@ -1,23 +0,0 @@
import socket
# Temporary fix from https://github.com/SeleniumHQ/selenium/pull/6480
# to avoid ConnectionError in selenium
def _selenium_is_connectable(port, host="localhost"):
"""
Tries to connect to the server at port to see if it is running.
:Args:
- port - The port to connect.
"""
socket_ = None
try:
socket_ = socket.create_connection((host, port), 1)
result = True
except (socket.error, ConnectionError):
result = False
finally:
if socket_:
socket_.close()
return result

View File

@ -29,7 +29,7 @@ function error() {
} }
PYODIDE_IMAGE_TAG="14" PYODIDE_IMAGE_TAG="15"
PYODIDE_PREBUILT_IMAGE_TAG="0.17.0a2" PYODIDE_PREBUILT_IMAGE_TAG="0.17.0a2"
DEFAULT_PYODIDE_DOCKER_IMAGE="pyodide/pyodide-env:${PYODIDE_IMAGE_TAG}" DEFAULT_PYODIDE_DOCKER_IMAGE="pyodide/pyodide-env:${PYODIDE_IMAGE_TAG}"
DEFAULT_PYODIDE_SYSTEM_PORT="8000" DEFAULT_PYODIDE_SYSTEM_PORT="8000"