Skip to content

Commit

Permalink
Use Chrome webdriver for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Dec 9, 2022
1 parent 8d8175e commit 2ee9e50
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: browser-actions/setup-chrome@latest
with:
chrome-version: 95.0.4638.17.0
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
Expand Down
5 changes: 2 additions & 3 deletions environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ includes:
environment:
# Tip: Use `--driver <driver_name>` to change driver for a single run
{% if TEST_QMXGRAPH %}
PYTEST_ADDOPTS: --driver Firefox
PYTEST_ADDOPTS: --driver Chrome
{% endif %}

dependencies:
Expand All @@ -18,8 +18,7 @@ dependencies:
{% if TEST_QMXGRAPH %}
- cherrypy
- hypothesis =3.11
- firefox
- geckodriver
- python-chromedriver-binary =95.0.4638.17.0
- pytest-mock
- pytest-qt
- pytest-rerunfailures
Expand Down
9 changes: 6 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@


def pytest_configure(config):
# Adds chromedriver binary to path.
import chromedriver_binary # noqa

# During warm up, clean up the temporary files/objects used by ports
# fixture from previous runs. Note these files are shared among ALL slaves
# of pytest so they can't reliably be removed by a fixture.
Expand All @@ -16,9 +19,9 @@ def pytest_configure(config):

# Fixtures --------------------------------------------------------------------
@pytest.fixture
def firefox_options(firefox_options):
firefox_options.headless = True
return firefox_options
def chrome_options(chrome_options):
chrome_options.headless = True
return chrome_options


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 2ee9e50

Please sign in to comment.