Skip to content

MAINT - Ensure Playwright tests use test sites and are run in CI #2133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ doc = [
"ipywidgets",
"graphviz",
]
test = ["pytest", "pytest-cov", "pytest-regressions", "sphinx[test]"]
dev = [
"pyyaml",
"pre-commit",
Expand All @@ -90,7 +89,13 @@ dev = [
"pandoc",
"sphinx-theme-builder[cli]",
]
a11y = ["pytest-playwright"]
test = [
"pytest",
"pytest-cov",
"pytest-regressions",
"sphinx[test]",
"pytest-playwright"
]
i18n = ["Babel", "jinja2"]

[project.entry-points]
Expand All @@ -109,7 +114,7 @@ indent-width = 4
ignore = [
"D107", # Missing docstring in `__init__` | set the docstring in the class
"D205", # 1 blank line required between summary line and description,
"D212", # docstring summary must be on first physical line
"D212", # docstring summary must be on first physical line
"W291", # let pre-commit handle trailing whitespace

]
Expand Down
11 changes: 0 additions & 11 deletions tests/test_a11y.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,6 @@ def test_notebook_ipywidget_output_tab_stop(page: Page, url_base: str) -> None:
assert ipywidget.evaluate("el => el.tabIndex") == 0


def test_breadcrumb_expansion(page: Page, url_base: str) -> None:
"""Foo."""
# page.goto(urljoin(url_base, "community/practices/merge.html"))
# expect(page.get_by_label("Breadcrumb").get_by_role("list")).to_contain_text("Merge and review policy") # noqa: E501
page.set_viewport_size({"width": 1440, "height": 720})
page.goto(urljoin(url_base, "community/topics/config.html"))
expect(page.get_by_label("Breadcrumb").get_by_role("list")).to_contain_text(
"Update Sphinx configuration during the build"
)


@pytest.mark.a11y
def test_search_as_you_type(page: Page, url_base: str) -> None:
"""Search-as-you-type feature should support keyboard navigation.
Expand Down
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,20 @@ description = "Run tests Python and Sphinx versions. If a Sphinx version is spec
# need to ensure the package is installed in editable mode
package = editable
extras =
test # install dependencies - defined in pyproject.toml
test # install dependencies, includes pytest-playwright - defined in pyproject.toml
pass_env = GITHUB_ACTIONS # so we can check if this is run on GitHub Actions
deps =
coverage[toml]
py39-sphinx61-tests: sphinx~=6.1.0
py312-sphinxdev: sphinx[test] @ git+https://github.com/sphinx-doc/sphinx.git@master
depends =
compile-assets,
i18n-compile
allowlist_externals=
playwright
bash
commands =
bash -c 'if [[ "{env:GITHUB_ACTIONS:}" == "true" ]]; then playwright install --with-deps; else playwright install; fi'
py3{9,10,11,12}{,-sphinx61,-sphinxdev,}-tests: coverage run -m pytest -m "not a11y" {posargs}
py3{9,10,11,12}{,-sphinx61,-sphinxdev,}-tests-no-cov: pytest -m "not a11y" {posargs}

Expand All @@ -82,8 +87,7 @@ description = run accessibility tests with Playwright and axe-core
base_python = py312 # keep in sync with tests.yml
pass_env = GITHUB_ACTIONS # so we can check if this is run on GitHub Actions
extras =
test
a11y
test # install dependencies, includes pytest-playwright - defined in pyproject.toml
depends =
compile-assets,
i18n-compile
Expand Down
Loading