Skip to content

Commit fc335e7

Browse files
committed
cleanups
1 parent 03f9eba commit fc335e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/test_playwright.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Using Axe-core, scan the Kitchen Sink pages for accessibility violations."""
1+
"""Build minimal test sites with sphinx_build_factory and test them with Playwright."""
22

33
from pathlib import Path
44
from urllib.parse import urljoin
@@ -9,7 +9,7 @@
99
playwright = pytest.importorskip("playwright")
1010
from playwright.sync_api import Page, expect # noqa: E402
1111

12-
path_repo = Path(__file__).parent.parent
12+
path_repo = Path(__file__).parents[1]
1313
path_docs_build = path_repo / "docs" / "_build" / "html"
1414

1515

@@ -44,16 +44,18 @@ def test_version_switcher_highlighting(page: Page, url_base: str) -> None:
4444

4545
def test_breadcrumb_expansion(page: Page, url_base: str) -> None:
4646
"""Test breadcrumb text-overflow."""
47+
# wide viewport width → no truncation
4748
page.set_viewport_size({"width": 1440, "height": 720})
4849
page.goto(urljoin(url_base, "community/topics/config.html"))
4950
expect(page.get_by_label("Breadcrumb").get_by_role("list")).to_contain_text(
5051
"Update Sphinx configuration during the build"
5152
)
5253
el = page.get_by_text("Update Sphinx configuration during the build").nth(1)
53-
assert not _is_overflowing(el)
5454
expect(el).to_have_css("overflow-x", "hidden")
5555
expect(el).to_have_css("text-overflow", "ellipsis")
56-
page.set_viewport_size({"width": 20, "height": 720})
56+
assert not _is_overflowing(el)
57+
# narrow viewport width → truncation
58+
page.set_viewport_size({"width": 150, "height": 720})
5759
assert _is_overflowing(el)
5860

5961

0 commit comments

Comments
 (0)