diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6629adb9..cb32fa69 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,9 +14,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ ! contains(github.ref, github.event.repository.default_branch) }}
-env:
- PYTEST_ADDOPTS: "-m 'not (edge or safari)'"
-
jobs:
linting:
runs-on: ubuntu-latest
@@ -37,28 +34,20 @@ jobs:
run: tox -e linting
test:
- name: ${{ matrix.os }} - ${{ matrix.python-version }}
- runs-on: ${{ matrix.os }}
+ name: ubuntu-latest - ${{ matrix.tox-env || matrix.python-version }}
+ runs-on: ubuntu-latest
strategy:
- fail-fast: true
+ fail-fast: false
matrix:
- os: [ubuntu-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: ubuntu-latest
python-version: pypy3.9
tox-env: py3.9
- - os: windows-latest
- python-version: pypy3.9
- tox-env: py3.9
-# TODO(jim) Deactivate devel tests pending troubleshooting
-# - os: ubuntu-latest
-# python-version: 3.12-dev
-# tox-env: devel
-# - os: windows-latest
-# python-version: 3.12-dev
-# tox-env: devel
+ - os: ubuntu-latest
+ python-version: 3.11
+ tox-env: devel
steps:
- uses: actions/checkout@v3
@@ -73,23 +62,8 @@ jobs:
python -m pip install --upgrade pip
pip install tox
- - name: Setup Firefox
- if: matrix.os == 'ubuntu-latest'
- uses: browser-actions/setup-firefox@latest
- with:
- firefox-version: latest
-
- - name: Setup Geckodriver
- if: matrix.os == 'ubuntu-latest'
- uses: browser-actions/setup-geckodriver@latest
-
- - name: Setup Chrome
- uses: browser-actions/setup-chrome@latest
- with:
- chrome-version: stable
-
- - name: Setup Chromedriver
- uses: nanasess/setup-chromedriver@master
+ - name: Start browsers
+ run: docker/start
- name: Cache tox environments
uses: actions/cache@v3
@@ -111,13 +85,6 @@ jobs:
fi
- name: Test
- if: matrix.os == 'ubuntu-latest'
- run: tox -e "${{ env.tox }}"
-
- - name: Test (skip firefox on windows)
- if: matrix.os == 'windows-latest'
- env:
- PYTEST_ADDOPTS: "-m 'not (edge or safari or firefox)'"
run: tox -e "${{ env.tox }}"
- name: Archive report.html
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 00000000..51e9d773
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,15 @@
+FROM python:3.10-slim-buster
+
+WORKDIR /usr/src/app
+
+ENV FLASK_APP=webserver.py
+ENV FLASK_RUN_HOST=0.0.0.0
+ENV FLASK_RUN_PORT=80
+
+RUN python -m pip install --upgrade pip && \
+ pip install flask
+
+COPY webserver.py .
+
+ENTRYPOINT ["flask"]
+CMD ["run"]
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
new file mode 100644
index 00000000..146d7948
--- /dev/null
+++ b/docker/docker-compose.yml
@@ -0,0 +1,80 @@
+# To execute this docker-compose yml file use `docker-compose -f docker-compose.intel.yml up`
+# Add the `-d` flag at the end for detached execution
+# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose-v3.yml down`
+version: "3"
+
+services:
+
+ chromium:
+ image: seleniarm/node-chromium:113.0
+ container_name: selenium-chromium
+ shm_size: 2gb
+ ports:
+ - "5901:5900"
+ - "7901:7900"
+ depends_on:
+ - selenium-hub
+ environment:
+ - SE_EVENT_BUS_HOST=selenium-hub
+ - SE_EVENT_BUS_PUBLISH_PORT=4442
+ - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
+ networks:
+ - grid
+
+ firefox:
+ image: seleniarm/node-firefox:112.0
+ container_name: selenium-firefox
+ shm_size: 2gb
+ ports:
+ - "5902:5900"
+ - "7902:7900"
+ depends_on:
+ - selenium-hub
+ environment:
+ - SE_EVENT_BUS_HOST=selenium-hub
+ - SE_EVENT_BUS_PUBLISH_PORT=4442
+ - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
+ networks:
+ - grid
+
+ edge:
+ image: selenium/node-edge:113.0
+ container_name: selenium-edge
+ shm_size: 2gb
+ ports:
+ - "5903:5900"
+ depends_on:
+ - selenium-hub
+ environment:
+ - SE_EVENT_BUS_HOST=selenium-hub
+ - SE_EVENT_BUS_PUBLISH_PORT=4442
+ - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
+ networks:
+ - grid
+ profiles:
+ - intel
+
+ selenium-hub:
+ image: seleniarm/hub:4.9.1
+ container_name: selenium-hub
+ ports:
+ - "4442:4442"
+ - "4443:4443"
+ - "4444:4444"
+ networks:
+ - grid
+
+ webserver:
+ container_name: webserver
+ build:
+ context: docker
+ environment:
+ - PYTHONDONTWRITEBYTECODE=1
+ networks:
+ - grid
+ depends_on:
+ - firefox
+ - chromium
+
+networks:
+ grid:
diff --git a/docker/start b/docker/start
new file mode 100755
index 00000000..3a5f9642
--- /dev/null
+++ b/docker/start
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+if [[ "${1}" == "down" ]]; then
+ docker compose --file docker/docker-compose.yml down
+ exit 0
+fi
+
+if [[ $(uname -m) == "arm64" ]]; then
+ docker compose --file docker/docker-compose.yml up -d
+else
+ docker compose --file docker/docker-compose.yml --profile intel up -d
+fi
diff --git a/docker/webserver.py b/docker/webserver.py
new file mode 100644
index 00000000..c34a6f46
--- /dev/null
+++ b/docker/webserver.py
@@ -0,0 +1,8 @@
+from flask import Flask
+
+app = Flask(__name__)
+
+
+@app.route("/")
+def home():
+ return """
Success!
LinkЁ
"""
diff --git a/docs/development.rst b/docs/development.rst
index b0beaa3b..fbae7542 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -47,39 +47,28 @@ Otherwise, to install and run, do:
Drivers
-------
-To run the tests you're going to need some browser drivers.
-Chromedriver
-~~~~~~~~~~~~
-To install the latest `chromedriver `_
-on your Mac or Linux (64-bit), run:
+The tests requires that Docker is available and uses the Selenium/Seleniarm containerized browsers and drivers.
-.. code-block:: bash
+Read more here: `Docker-Seleniarm `_
+
+To start the browsers (and drivers):
- $ ./installation/chromedriver.sh
+.. code-block:: bash
-For Windows users, please see `here `_.
+ $ docker/start
-Geckodriver
-~~~~~~~~~~~
-To install the latest `geckodriver `_
-on your Mac or Linux (64-bit), run:
+You can check status by running:
.. code-block:: bash
- $ ./installation/geckodriver.sh
+ $ docker ps
-Safaridriver
-~~~~~~~~~~~~
-Instructions for `safaridriver `_.
+To stop the containers, run:
-Edgedriver
-~~~~~~~~~~
-Instructions for `edgedriver `_.
+.. code-block:: bash
-IEDriver
-~~~~~~~~
-Instructions for `iedriver `_.
+ $ docker/start down
Releasing a new version
-----------------------
diff --git a/pyproject.toml b/pyproject.toml
index 15b84a8b..731bee05 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -59,7 +59,6 @@ dynamic = [
[project.optional-dependencies]
appium = [ "appium-python-client>=1.0.0" ]
test = [
- "pytest-localserver>=0.5.0",
"pytest-xdist>=2.4.0",
"pytest-mock>=3.6.1",
"black>=22.1.0",
diff --git a/testing/conftest.py b/testing/conftest.py
index 58acf864..bf5279de 100644
--- a/testing/conftest.py
+++ b/testing/conftest.py
@@ -9,13 +9,13 @@
pytest_plugins = "pytester"
-def base_url(httpserver):
- return httpserver.url
+def base_url():
+ return "http://webserver"
@pytest.fixture
-def httpserver_base_url(httpserver):
- return "--base-url={0}".format(base_url(httpserver))
+def httpserver_base_url():
+ return "--base-url={0}".format(base_url())
@pytest.fixture(autouse=True)
@@ -59,14 +59,28 @@ def chrome_options(chrome_options):
def runpytestqa(*args, **kwargs):
return testdir.runpytest(
- httpserver_base_url, "--driver", "Firefox", *args, **kwargs
+ httpserver_base_url,
+ "--driver",
+ "remote",
+ "--capability",
+ "browserName",
+ "firefox",
+ *args,
+ **kwargs,
)
testdir.runpytestqa = runpytestqa
def inline_runqa(*args, **kwargs):
return testdir.inline_run(
- httpserver_base_url, "--driver", "Firefox", *args, **kwargs
+ httpserver_base_url,
+ "--driver",
+ "remote",
+ "--capability",
+ "browserName",
+ "firefox",
+ *args,
+ **kwargs,
)
testdir.inline_runqa = inline_runqa
diff --git a/testing/test_chrome.py b/testing/test_chrome.py
index f65afd1e..1d94cd4d 100644
--- a/testing/test_chrome.py
+++ b/testing/test_chrome.py
@@ -10,8 +10,7 @@
@pytest.mark.chrome
-def test_launch(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_launch(testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -20,7 +19,15 @@ def test_pass(webtext):
assert webtext == u'Success!'
"""
)
- testdir.quick_qa("--driver", "Chrome", file_test, passed=1)
+ testdir.quick_qa(
+ "--driver",
+ "Remote",
+ "--capability",
+ "browserName",
+ "chrome",
+ file_test,
+ passed=1,
+ )
@pytest.mark.chrome
@@ -37,13 +44,16 @@ def chrome_options(chrome_options):
def test_pass(selenium): pass
"""
)
- reprec = testdir.inline_run("--driver", "Chrome")
+ reprec = testdir.inline_run(
+ "--driver", "Remote", "--capability", "browserName", "chrome"
+ )
passed, skipped, failed = reprec.listoutcomes()
assert len(failed) == 1
out = failed[0].longrepr.reprcrash.message
assert "no chrome binary at /foo/bar" in out
+@pytest.mark.xfail(reason="Remote driver currently doesn't support logs")
@pytest.mark.chrome
def test_args(testdir):
file_test = testdir.makepyfile(
@@ -61,5 +71,13 @@ def driver_args():
def test_pass(selenium): pass
"""
)
- testdir.quick_qa("--driver", "Chrome", file_test, passed=1)
+ testdir.quick_qa(
+ "--driver",
+ "Remote",
+ "--capability",
+ "browserName",
+ "chrome",
+ file_test,
+ passed=1,
+ )
assert os.path.exists(str(testdir.tmpdir.join("foo.log")))
diff --git a/testing/test_destructive.py b/testing/test_destructive.py
index ae230340..b6778c13 100644
--- a/testing/test_destructive.py
+++ b/testing/test_destructive.py
@@ -12,31 +12,30 @@ def test_skip_destructive_by_default(testdir):
testdir.quick_qa(file_test, passed=0, failed=0, skipped=1)
-def test_warn_when_url_is_sensitive(testdir, httpserver, monkeypatch, capsys):
- monkeypatch.setenv("SENSITIVE_URL", r"127\.0\.0\.1")
+def test_warn_when_url_is_sensitive(testdir, monkeypatch, capsys):
+ monkeypatch.setenv("SENSITIVE_URL", r"webserver")
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa(file_test, "--verbose", passed=0, failed=0, skipped=1)
out, err = capsys.readouterr()
- msg = "*** WARNING: sensitive url matches {} ***".format(httpserver.url)
+ msg = "*** WARNING: sensitive url matches http://webserver ***"
assert msg in out
-def test_skip_destructive_when_sensitive_command_line(testdir, httpserver):
+def test_skip_destructive_when_sensitive_command_line(testdir):
file_test = testdir.makepyfile("def test_pass(): pass")
- print(httpserver.url)
testdir.quick_qa(
- "--sensitive-url", r"127\.0\.0\.1", file_test, passed=0, failed=0, skipped=1
+ "--sensitive-url", "webserver", file_test, passed=0, failed=0, skipped=1
)
-def test_skip_destructive_when_sensitive_config_file(testdir, httpserver):
- testdir.makefile(".ini", pytest="[pytest]\nsensitive_url=127\\.0\\.0\\.1")
+def test_skip_destructive_when_sensitive_config_file(testdir):
+ testdir.makefile(".ini", pytest="[pytest]\nsensitive_url=webserver")
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa(file_test, passed=0, failed=0, skipped=1)
-def test_skip_destructive_when_sensitive_env(testdir, httpserver, monkeypatch):
- monkeypatch.setenv("SENSITIVE_URL", r"127\.0\.0\.1")
+def test_skip_destructive_when_sensitive_env(testdir, monkeypatch):
+ monkeypatch.setenv("SENSITIVE_URL", "webserver")
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa(file_test, passed=0, failed=0, skipped=1)
@@ -52,18 +51,18 @@ def test_pass(): pass
testdir.quick_qa(file_test, passed=1)
-def test_run_destructive_when_not_sensitive_command_line(testdir, httpserver):
+def test_run_destructive_when_not_sensitive_command_line(testdir):
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa("--sensitive-url", "foo", file_test, passed=1)
-def test_run_destructive_when_not_sensitive_config_file(testdir, httpserver):
+def test_run_destructive_when_not_sensitive_config_file(testdir):
testdir.makefile(".ini", pytest="[pytest]\nsensitive_url=foo")
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa(file_test, passed=1, failed=0, skipped=0)
-def test_run_destructive_when_not_sensitive_env(testdir, httpserver, monkeypatch):
+def test_run_destructive_when_not_sensitive_env(testdir, monkeypatch):
monkeypatch.setenv("SENSITIVE_URL", "foo")
file_test = testdir.makepyfile("def test_pass(): pass")
testdir.quick_qa(file_test, passed=1, failed=0, skipped=0)
diff --git a/testing/test_driver.py b/testing/test_driver.py
index 07e01465..ca456b2d 100644
--- a/testing/test_driver.py
+++ b/testing/test_driver.py
@@ -203,6 +203,7 @@ def test_provider_naming(name):
assert provider.name == name
+@pytest.mark.xfail(reason="Remote driver currently doesn't support logs")
def test_service_log_path(testdir):
file_test = testdir.makepyfile(
"""
@@ -212,9 +213,10 @@ def test_pass(driver_kwargs):
assert driver_kwargs['service_log_path'] is not None
"""
)
- testdir.quick_qa("--driver", "Firefox", file_test, passed=1)
+ testdir.quick_qa(file_test, passed=1)
+@pytest.mark.xfail(reason="Remote driver currently doesn't support logs")
def test_no_service_log_path(testdir):
file_test = testdir.makepyfile(
"""
@@ -228,7 +230,7 @@ def test_pass(driver_kwargs):
assert driver_kwargs['service_log_path'] is None
"""
)
- testdir.quick_qa("--driver", "Firefox", file_test, passed=1)
+ testdir.quick_qa(file_test, passed=1)
def test_driver_retry_pass(testdir, mocker):
@@ -248,7 +250,7 @@ def test_pass(driver):
"""
)
- testdir.quick_qa("--driver", "Firefox", file_test, passed=1)
+ testdir.quick_qa(file_test, passed=1)
assert mock_retrying.spy_return.statistics["attempt_number"] == 1
@@ -296,4 +298,4 @@ def test_xdist(driver):
pass
"""
)
- testdir.quick_qa("--driver", "firefox", "-n", "2", file_test, passed=1)
+ testdir.quick_qa("-n", "2", file_test, passed=1)
diff --git a/testing/test_driver_log.py b/testing/test_driver_log.py
index d2ac77df..883a2c51 100644
--- a/testing/test_driver_log.py
+++ b/testing/test_driver_log.py
@@ -12,8 +12,8 @@
LOG_REGEX = 'Driver Log'
-def test_driver_log(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+@pytest.mark.xfail(reason="Remote driver currently doesn't support logs")
+def test_driver_log(testdir):
testdir.makepyfile(
"""
import pytest
@@ -26,13 +26,14 @@ def test_driver_log(webtext):
testdir.runpytestqa("--html", path)
with open(str(path)) as f:
html = f.read()
+
assert re.search(LOG_REGEX, html) is not None
log_path = testdir.tmpdir.dirpath("basetemp", "test_driver_log0", "driver.log")
assert os.path.exists(str(log_path))
-def test_driver_log_fixture(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+@pytest.mark.xfail(reason="Remote driver currently doesn't support logs")
+def test_driver_log_fixture(testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -49,8 +50,7 @@ def test_pass(webtext):
assert os.path.exists(str(testdir.tmpdir.join("foo.log")))
-def test_no_driver_log(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_no_driver_log(testdir):
testdir.makepyfile(
"""
import pytest
diff --git a/testing/test_edge.py b/testing/test_edge.py
index 18a8fb2a..9f1d2903 100644
--- a/testing/test_edge.py
+++ b/testing/test_edge.py
@@ -1,18 +1,18 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import pytest
import sys
+import pytest
-pytestmark = pytest.mark.nondestructive
+pytestmark = [
+ pytest.mark.nondestructive,
+ pytest.mark.skipif(sys.platform != "win32", reason="Edge only runs on Windows"),
+ pytest.mark.edge,
+]
-@pytest.mark.skipif(sys.platform != "win32", reason="Edge only runs on Windows")
-@pytest.mark.edge
-def test_launch_legacy(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_launch_legacy(testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -21,14 +21,13 @@ def test_pass(webtext):
assert webtext == u'Success!'
"""
)
- testdir.quick_qa("--driver", "Edge", file_test, passed=1)
+ testdir.quick_qa(
+ "--driver", "remote", "--capability", "browserName", "edge", file_test, passed=1
+ )
-@pytest.mark.skipif(sys.platform != "win32", reason="Edge only runs on Windows")
-@pytest.mark.edge
@pytest.mark.parametrize("use_chromium", [True, False], ids=["chromium", "legacy"])
-def test_launch(use_chromium, testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_launch(use_chromium, testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -45,4 +44,6 @@ def edge_options(edge_options):
use_chromium
)
)
- testdir.quick_qa("--driver", "Edge", file_test, passed=1)
+ testdir.quick_qa(
+ "--driver", "remote", "--capability", "browserName", "edge", file_test, passed=1
+ )
diff --git a/testing/test_firefox.py b/testing/test_firefox.py
index 68476da9..d11b6817 100644
--- a/testing/test_firefox.py
+++ b/testing/test_firefox.py
@@ -7,8 +7,7 @@
pytestmark = [pytest.mark.nondestructive, pytest.mark.firefox]
-def test_launch(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_launch(testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -20,8 +19,7 @@ def test_pass(webtext):
testdir.quick_qa(file_test, passed=1)
-def test_launch_case_insensitive(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
+def test_launch_case_insensitive(testdir):
file_test = testdir.makepyfile(
"""
import pytest
@@ -30,16 +28,15 @@ def test_pass(webtext):
assert webtext == u'Success!'
"""
)
- testdir.quick_qa("--driver", "firefox", file_test, passed=1)
+ testdir.quick_qa(file_test, passed=1)
-def test_profile(testdir, httpserver):
+def test_profile(testdir):
"""Test that specified profile is used when starting Firefox.
The profile changes the colors in the browser, which are then reflected
when calling value_of_css_property.
"""
- httpserver.serve_content(content='Success!
Link')
file_test = testdir.makepyfile(
"""
import pytest
@@ -96,9 +93,8 @@ def test_extension(selenium):
testdir.quick_qa("--firefox-extension", extension, file_test, passed=1)
-def test_preferences_marker(testdir, httpserver):
+def test_preferences_marker(testdir):
"""Test that preferences can be specified using the marker."""
- httpserver.serve_content(content='Success!
Link')
file_test = testdir.makepyfile(
"""
import pytest
diff --git a/testing/test_report.py b/testing/test_report.py
index 7630bd0a..593b9703 100644
--- a/testing/test_report.py
+++ b/testing/test_report.py
@@ -38,8 +38,7 @@ def test_fail(webtext):
@pytest.mark.parametrize("when", ["always", "failure", "never"])
-def test_capture_debug_env(testdir, httpserver, monkeypatch, when):
- httpserver.serve_content(content="Success!
Ё
")
+def test_capture_debug_env(testdir, monkeypatch, when):
monkeypatch.setenv("SELENIUM_CAPTURE_DEBUG", when)
testdir.makepyfile(
"""
@@ -53,22 +52,21 @@ def test_capture_debug(webtext):
)
result, html = run(testdir)
if when in ["always", "failure"]:
- assert URL_LINK.format(httpserver.url) in html
+ assert URL_LINK.format("http://webserver") in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
- assert re.search(LOGS_REGEX, html) is not None
+ # assert re.search(LOGS_REGEX, html) is not None
assert re.search(HTML_REGEX, html) is not None
else:
- assert URL_LINK.format(httpserver.url) not in html
+ assert URL_LINK.format("http://webserver") not in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
assert re.search(SCREENSHOT_REGEX, html) is None
- assert re.search(LOGS_REGEX, html) is None
+ # assert re.search(LOGS_REGEX, html) is None
assert re.search(HTML_REGEX, html) is None
@pytest.mark.parametrize("when", ["always", "failure", "never"])
-def test_capture_debug_config(testdir, httpserver, when):
- httpserver.serve_content(content="Success!
Ё
")
+def test_capture_debug_config(testdir, when):
testdir.makefile(
".ini",
pytest="""
@@ -90,30 +88,29 @@ def test_capture_debug(webtext):
)
result, html = run(testdir)
if when in ["always", "failure"]:
- assert URL_LINK.format(httpserver.url) in html
+ assert URL_LINK.format("http://webserver") in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
- assert re.search(LOGS_REGEX, html) is not None
+ # assert re.search(LOGS_REGEX, html) is not None
assert re.search(HTML_REGEX, html) is not None
else:
- assert URL_LINK.format(httpserver.url) not in html
+ assert URL_LINK.format("http://webserver") not in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
assert re.search(SCREENSHOT_REGEX, html) is None
- assert re.search(LOGS_REGEX, html) is None
+ # assert re.search(LOGS_REGEX, html) is None
assert re.search(HTML_REGEX, html) is None
@pytest.mark.parametrize("exclude", ["url", "screenshot", "html", "logs"])
-def test_exclude_debug_env(testdir, httpserver, monkeypatch, exclude):
- httpserver.serve_content(content="Success!
Ё
")
+def test_exclude_debug_env(testdir, monkeypatch, exclude):
monkeypatch.setenv("SELENIUM_EXCLUDE_DEBUG", exclude)
result, html = run(testdir)
assert result.ret
if exclude == "url":
- assert URL_LINK.format(httpserver.url) not in html
+ assert URL_LINK.format("http://webserver") not in html
else:
- assert URL_LINK.format(httpserver.url) in html
+ assert URL_LINK.format("http://webserver") in html
if exclude == "screenshot":
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
@@ -122,10 +119,10 @@ def test_exclude_debug_env(testdir, httpserver, monkeypatch, exclude):
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
- if exclude == "logs":
- assert re.search(LOGS_REGEX, html) is None
- else:
- assert re.search(LOGS_REGEX, html) is not None
+ # if exclude == "logs":
+ # assert re.search(LOGS_REGEX, html) is None
+ # else:
+ # assert re.search(LOGS_REGEX, html) is not None
if exclude == "html":
assert re.search(HTML_REGEX, html) is None
@@ -134,8 +131,7 @@ def test_exclude_debug_env(testdir, httpserver, monkeypatch, exclude):
@pytest.mark.parametrize("exclude", ["url", "screenshot", "html", "logs"])
-def test_exclude_debug_config(testdir, httpserver, exclude):
- httpserver.serve_content(content="Success!
Ё
")
+def test_exclude_debug_config(testdir, exclude):
testdir.makefile(
".ini",
pytest="""
@@ -149,9 +145,9 @@ def test_exclude_debug_config(testdir, httpserver, exclude):
assert result.ret
if exclude == "url":
- assert URL_LINK.format(httpserver.url) not in html
+ assert URL_LINK.format("http://webserver") not in html
else:
- assert URL_LINK.format(httpserver.url) in html
+ assert URL_LINK.format("http://webserver") in html
if exclude == "screenshot":
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
@@ -160,10 +156,10 @@ def test_exclude_debug_config(testdir, httpserver, exclude):
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
- if exclude == "logs":
- assert re.search(LOGS_REGEX, html) is None
- else:
- assert re.search(LOGS_REGEX, html) is not None
+ # if exclude == "logs":
+ # assert re.search(LOGS_REGEX, html) is None
+ # else:
+ # assert re.search(LOGS_REGEX, html) is not None
if exclude == "html":
assert re.search(HTML_REGEX, html) is None
diff --git a/testing/test_safari.py b/testing/test_safari.py
deleted file mode 100644
index 50705eaf..00000000
--- a/testing/test_safari.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import pytest
-
-pytestmark = pytest.mark.nondestructive
-
-
-@pytest.mark.safari
-def test_launch(testdir, httpserver):
- httpserver.serve_content(content="Success!
")
- file_test = testdir.makepyfile(
- """
- import pytest
- @pytest.mark.nondestructive
- def test_pass(webtext):
- assert webtext == u'Success!'
- """
- )
- testdir.quick_qa("--driver", "Safari", file_test, passed=1)
diff --git a/testing/test_saucelabs.py b/testing/test_saucelabs.py
index 281bb903..d5163a90 100644
--- a/testing/test_saucelabs.py
+++ b/testing/test_saucelabs.py
@@ -127,12 +127,7 @@ def run_sauce_test(monkeypatch, testdir, file_test):
)
testdir.quick_qa(
- "--driver",
- "saucelabs",
- "--variables",
- variables,
- file_test,
- passed=1,
+ "--driver", "saucelabs", "--variables", variables, file_test, passed=1
)
diff --git a/testing/test_webdriver.py b/testing/test_webdriver.py
index 16dbed50..f2f483a1 100644
--- a/testing/test_webdriver.py
+++ b/testing/test_webdriver.py
@@ -8,7 +8,7 @@
pytestmark = pytest.mark.nondestructive
-def test_event_listening_webdriver(testdir, httpserver):
+def test_event_listening_webdriver(testdir):
file_test = testdir.makepyfile(
"""
import pytest
diff --git a/tox.ini b/tox.ini
index b424b1e6..8252bb1d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,6 @@ setenv =
PYTHONDONTWRITEBYTECODE=1
MOZ_HEADLESS=1
deps =
- pytest-localserver
pytest-xdist
pytest-mock
commands = pytest -n auto -s -ra --color=yes --strict-config --strict-markers --html={envlogdir}/report.html --self-contained-html {posargs}
@@ -37,6 +36,7 @@ basepython = python3
pip_pre = True
deps =
{[testenv]deps}
+ pytest-html<4.0.0
py # removed in latest pytest and needs fixing
pytest @ git+https://github.com/pytest-dev/pytest.git
@@ -54,7 +54,6 @@ testpaths = testing
markers =
firefox
edge
- safari
chrome
skip_selenium
nondestructive