mirror of https://github.com/pyodide/pyodide.git
MAINT Update to selenium 4.0.0.b3 (#1422)
This commit is contained in:
parent
025e295470
commit
5a2f7d027f
|
@ -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
|
||||||
|
|
|
@ -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 \
|
||||||
|
|
23
conftest.py
23
conftest.py
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
|
@ -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"
|
||||||
|
|
Loading…
Reference in New Issue