Skip to content

Commit a4431af

Browse files
committed
Use Chrome webdriver for tests
1 parent 8d8175e commit a4431af

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v2
23+
- uses: browser-actions/setup-chrome@latest
24+
with:
25+
chrome-version: 95
2326
- uses: conda-incubator/setup-miniconda@v2
2427
with:
2528
auto-update-conda: true

environment.devenv.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ includes:
99
environment:
1010
# Tip: Use `--driver <driver_name>` to change driver for a single run
1111
{% if TEST_QMXGRAPH %}
12-
PYTEST_ADDOPTS: --driver Firefox
12+
PYTEST_ADDOPTS: --driver Chrome
1313
{% endif %}
1414

1515
dependencies:
@@ -18,8 +18,7 @@ dependencies:
1818
{% if TEST_QMXGRAPH %}
1919
- cherrypy
2020
- hypothesis =3.11
21-
- firefox
22-
- geckodriver
21+
- python-chromedriver-binary =95
2322
- pytest-mock
2423
- pytest-qt
2524
- pytest-rerunfailures

tests/conftest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55

66
def pytest_configure(config):
7+
# Adds chromedriver binary to path.
8+
import chromedriver_binary # noqa
9+
710
# During warm up, clean up the temporary files/objects used by ports
811
# fixture from previous runs. Note these files are shared among ALL slaves
912
# of pytest so they can't reliably be removed by a fixture.
@@ -16,9 +19,9 @@ def pytest_configure(config):
1619

1720
# Fixtures --------------------------------------------------------------------
1821
@pytest.fixture
19-
def firefox_options(firefox_options):
20-
firefox_options.headless = True
21-
return firefox_options
22+
def chrome_options(chrome_options):
23+
chrome_options.headless = True
24+
return chrome_options
2225

2326

2427
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)