JUnit 5
Use this guide when your Selenium tests use JUnit 5 (Jupiter). Accessibility is still driven entirely by grid capabilities and the lambda-accessibility-scan hook (or auto-scan), identical to the Selenium Accessibility Automation flow—only the test lifecycle annotations differ.
Browsers: Use Chrome or Edge with supported versions for Accessibility Automation.
Prerequisites
- TestMu AI credentials as environment variables (guide)
- JUnit 5 on the classpath (
junit-jupiter-api, etc.) driving Selenium - Accessibility enabled for your account
Onboarding path
1. Centralize driver creation
Use @BeforeEach or @BeforeAll (with a static WebDriver if you share one per class) to build MutableCapabilities / ChromeOptions once. Every test method should inherit the same Accessibility flags.
2. Enable Accessibility on the session
capabilities.setCapability("accessibility", true);
capabilities.setCapability("accessibility.wcagVersion", "wcag21aa"); // optional
See Configure Accessibility Automation for all flags.
3. Trigger scans
Hook after stable UI:
driver.executeScript("lambda-accessibility-scan");
Or auto-scan every navigation:
capabilities.setCapability("accessibility.autoscan", true);
4. Run and verify
mvn test
Open the Automation Dashboard → session → Accessibility tab.
5. Scale to the full suite
Add @Tag("a11y") or parallel config if you want selective Accessibility runs in CI; keep capability setup shared so behavior stays consistent.
Troubleshooting
| Symptom | What to check |
|---|---|
| No report | accessibility: true plus hook or accessibility.autoscan. |
| Multiple scans on one test | You called the hook more than once; reduce to one stable checkpoint per logical page. |
