Skip to content

Commit fd5ba93

Browse files
pamelafoxCopilot
andauthored
Fix a11y landmark issue and add Axe Playwright test (#2687)
* a11y: add single main landmark and basic Axe accessibility test; add axe-playwright-python dev dep (#2677) * Update fixer mode with PR instructions * Update app/frontend/src/pages/layout/Layout.tsx Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 58ca0de commit fd5ba93

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.github/chatmodes/fixer.chatmode.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: 'Fix and verify issues in app'
33
model: GPT-5 (Preview)
4-
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server']
4+
tools: ['extensions', 'codebase', 'usages', 'vscodeAPI', 'problems', 'changes', 'testFailure', 'fetch', 'findTestFiles', 'searchResults', 'githubRepo', 'runTests', 'runCommands', 'runTasks', 'editFiles', 'runNotebooks', 'search', 'new', 'create_pull_request', 'get_issue', 'get_issue_comments', 'get-library-docs', 'playwright', 'pylance mcp server']
55
---
66

77
# Fixer Mode Instructions
@@ -25,3 +25,8 @@ You MUST check task output readiness before debugging, testing, or declaring wor
2525
- Backend: Quart was started with --reload; Python changes trigger an automatic restart.
2626
- If watchers seem stuck or output stops updating, stop the tasks and run the "Development" task again.
2727
- To interact with a running application, use the Playwright MCP server
28+
29+
## Committing the change
30+
31+
When change is complete, offer to make a new branch, git commit, and pull request.
32+
Make sure the PR follows the PULL_REQUEST_TEMPLATE.md format, with all sections filled out and appropriate checkboxes checked.

app/frontend/src/pages/layout/Layout.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
height: 100%;
55
}
66

7+
.main {
8+
display: flex;
9+
flex: 1;
10+
min-height: 0; /* allow inner scroll areas to work inside flex container */
11+
}
12+
713
.header {
814
background-color: #222222;
915
color: #f2f2f2;

app/frontend/src/pages/layout/Layout.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ const Layout = () => {
7575
</div>
7676
</header>
7777

78-
<Outlet />
78+
<main className={styles.main} id="main-content">
79+
<Outlet />
80+
</main>
7981
</div>
8082
);
8183
};

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ pytest-snapshot
1212
pre-commit
1313
pip-tools
1414
mypy==1.14.1
15+
axe-playwright-python

tests/e2e.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111
import requests
1212
import uvicorn
13+
from axe_playwright_python.sync_playwright import Axe
1314
from playwright.sync_api import Page, Route, expect
1415

1516
import app
@@ -110,6 +111,10 @@ def handle(route: Route):
110111
expect(page.get_by_role("button", name="Clear chat")).to_be_disabled()
111112
expect(page.get_by_role("button", name="Developer settings")).to_be_enabled()
112113

114+
# Check accessibility of page in initial state
115+
results = Axe().run(page)
116+
assert results.violations_count == 0, results.generate_report()
117+
113118
# Ask a question and wait for the message to appear
114119
page.get_by_placeholder("Type a new question (e.g. does my plan cover annual eye exams?)").click()
115120
page.get_by_placeholder("Type a new question (e.g. does my plan cover annual eye exams?)").fill(

0 commit comments

Comments
 (0)