Repository navigation
test: hydrated homepage a11y, sign-in page, mobile menu and API host header coverage - #19
Draft
saqibmanan wants to merge 13 commits into
Draft
saqibmanan wants to merge 13 commits into
saqibmanan wants to merge 13 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coverage for the public, unauthenticated surface of the dev site, plus a review of merged ParakhAI-frontend changes since 2026-07-01. Tests only: no product code was touched. Known defects are asserted as the correct behaviour under strict xfail and logged in
docs/app_bugs.md(#31-#40) anddocs/a11y_findings.md(a5-a12).Why
HomePage.go_to_home()returns at theloadevent. Nav, hero, feature tabs and footer arenext/dynamic({ ssr: false }), so at that point the page has no<h1>, no footer links and no tabs (measured 4/4 loads). The existing homepage axe test therefore scans an empty skeleton and passes, while the page users see has two serious axe rules failing. Every new homepage test waits for hydration first (HomePage.wait_until_hydrated).Merged product PRs
test_meta_description_has_no_typo(strict xfail, bug [pending ParakhAI-frontend#442] test: mobile nav dialog accessible name #16). The fix is onmainand live on prod (parakh.civicdataspace.inserves "Participatory"), but commit 9919bdb is not on thedevbranch, so dev still has the typo. Against prod the existing test XPASSes strict, as designed. No duplicate test added; [pending ParakhAI-frontend#442] test: mobile nav dialog accessible name #16 annotated.Tests (13 new, 5 files)
test_accessibility_hydrated.py::TestHydratedHomepageAxe::test_no_untracked_serious_axe_violationslink-name(#9) andcolor-contrast(#31)...::test_color_contrast_meets_aa...TestHydratedHomepageFeatureTabs::test_selected_tab_is_exposed_to_assistive_tech...TestHydratedHomepageLanguage::test_non_english_passages_declare_their_languagelang...TestHydratedHomepageReflow::test_no_horizontal_scroll_at_320pxtest_accessibility_signin.py::...::test_provider_logo_has_alt_attributealttest_accessibility_mobile_menu.py::...::test_dialog_has_accessible_name...::test_close_button_has_accessible_name...::test_escape_closes_menu...::test_focus_returns_to_hamburger_after_closetests/api/test_sitemap_content.py::...::test_sitemap_is_xml_or_not_found/sitemap.xmlis XML or 404, not a 200 HTML shelltests/api/test_api_host_headers.py::...::test_server_header_does_not_disclose_versionServerhas no version/OS...::test_security_headers_are_not_duplicated_with_conflicting_valuesPage objects and locators extended rather than bypassed:
HomePage(hydration wait, tab flags, language-of-parts scan, overflow probe, mobile-sheet helpers),LoginPage(go_to_provider_signin, logo alts),home_locators.py,login_locators.py. All new files fall under the existingaccessibility/apiCI path filters and markers.Run evidence (against https://dev.parakh.civicdataspace.in,
--reruns 0)3 passed, 10 xfailedx3 (about 62s each).pytest --collect-only: 865 tests collected, no errors under--strict-markers.ruff checkon every touched file: clean (the repo has 28 pre-existing findings on main, unchanged).Red proof (throwaway monkeypatch plugins kept outside the repo)
<img>without alt after hydration ->AssertionError: 1 new critical/serious axe violation(s) ... "id": "image-alt".main{min-width:600px}->scrollWidth=600 > clientWidth=320.The mobile menu dialog is still visible after pressing Escape.--runxfailshows the real failure at the intended assertion, e.g.Element has insufficient color contrast of 4.49 (foreground color: #6849ee, background color: #e8e4ff ...),Conflicting duplicate response headers ... {'X-Frame-Options': ['DENY', 'SAMEORIGIN'], ...},Server header discloses ... 'nginx/1.24.0 (Ubuntu)'. (2) A plugin that simulates the product fix turns each into[XPASS(strict)] ... FAILED, so the suite goes red when the defect is fixed. For the sitemap test, a 404 and a valid XML response both XPASS, while a 200 XML document with the wrong root stays XFAIL.Not covered
.env; the sandbox TEST_* values belong to another product and were not used): all authenticated e2e/a11y/visual/GraphQL, #445 modal, #446/#452/#457 evaluations table, write flows. Full list in the findings reports.aria-expandedon the hamburger, landmarks on the NextAuth template.Honest weak points
test_color_contrast_meets_aastays xfail if a second contrast problem appears, and a timeout inwait_until_hydratedwould also read as XFAIL. The green axe guard andtest_escape_closes_menulimit this but do not remove it.langon the nearest ancestor, so a coarse fix (onelang="hi"on a whole mixed sentence) would pass; my fix simulation did exactly that.test_focus_returns_to_hamburger_after_closeencodes WCAG 2.4.3 best practice, which is an interpretation rather than a hard success-criterion failure.api_clientUA (ParakhTestFramework/1.0); if that host starts rejecting non-browser UAs they fail at the status assertion.test_homepage_has_no_critical_axe_violations,test_images_have_alt_text,test_buttons_have_accessible_namesandtest_feature_tabs_have_aria_statesshare the pre-hydration/skip weakness; they were not edited here (existing tests, other people's PRs may touch them). The new guard test supersedes the axe one in practice.playwright==1.63.0(pre-installed browser); repo requirements are unchanged.