Skip to content

Commit

Permalink
tests: Use options and fixtures to control all browsers (#1300)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler authored Jun 21, 2024
1 parent 1dc6f01 commit 68b96cd
Show file tree
Hide file tree
Showing 73 changed files with 2,448 additions and 2,546 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ jobs:
run: |
gtimeout 60 bash -c 'while ! wget -O /dev/null -T 1 http://localhost:4444/readyz; do echo waiting for selenium server; sleep 1; done' || (cat selenium-standalone.log && exit 2)
tox -e tests_selenium_safari -- --cache-clear -n 1 tests || tox -e tests_selenium_safari -- -n 1 --last-failed --last-failed-no-failures none
tox -e tests_selenium_remote_safari -- --cache-clear -n 1 || tox -e tests_selenium_remote_safari -- -n 1 --last-failed --last-failed-no-failures none
11 changes: 7 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ jobs:
- name: Install test dependencies
run: pip install tox

- name: Run tests
- name: Run splinter tests
run: |
tox -e tests_splinter -- -n 4
- name: Run non-webdriver driver tests
- name: Run lxml-based driver tests
run: |
tox -e tests_lxml_drivers -- -n 4
tox -e tests_django -- -n 2;
tox -e tests_flask -- -n 2;
tox -e tests_zopetestbrowser -- -n 2;
tests_selenium_remote:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,7 +93,8 @@ jobs:
xvfb-run java -jar selenium-server.jar standalone > selenium-server.log 2>&1 &
timeout 60 bash -c 'while ! wget -O /dev/null -T 1 http://localhost:4444/readyz; do echo waiting for selenium server; sleep 1; done' || (cat selenium-server.log && exit 2)
echo "Selenium server is ready, running tests"
tox -e tests_selenium_remote
tox -e tests_selenium_remote_firefox
tox -e tests_selenium_remote_chrome
tests_selenium:
runs-on: ubuntu-latest
Expand Down
3 changes: 1 addition & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[pytest]
markers =
macos: tests can be runned only on MacOS (Safari)
addopts = -v --durations=10
8 changes: 3 additions & 5 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Flask==3.0.3
coverage==7.5.3
argparse
Django>=2.0.6
coverage==7.5.3
Flask==3.0.3
pytest==8.2.2
pytest-xdist==3.6.1
pytest-ignore-flaky==2.2.1
zope.testbrowser==7.0
pytest-xdist==3.6.1
4 changes: 0 additions & 4 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,16 @@ ignore = [

[lint.per-file-ignores]
"tests/**" = [
"B015",
"B018",
"BLE001",
"C901",
"S101",
"S105",
"S310",
"PLR0911",
"PLW0603",
"PTH100",
"PTH113",
"PTH118",
"PTH120",
"T201",
"TRY002",
]
"samples/**" = [
Expand Down
311 changes: 0 additions & 311 deletions tests/base.py

This file was deleted.

Loading

0 comments on commit 68b96cd

Please sign in to comment.