arrow-left Back to topicQuizAccessibility testingCheck yourself1.You want to scan only the navigation menu for accessibility issues, not the whole page. What do you use?new AxeBuilder({ page }).include('nav').analyze()new AxeBuilder({ page }).exclude('main').analyze()page.locator('nav').analyze()new AxeBuilder({ page }).scope('nav').analyze()2.Which npm package provides the axe-core integration for Playwright?axe-playwrightplaywright-axe@axe-core/playwright@playwright/axe3.Approximately what percentage of WCAG issues does axe-core catch automatically?~20%~57%~80%~100%4.You need to scan a modal dialog for accessibility issues, but the modal only appears after clicking a button. In what order must you perform these actions?Call analyze() first, then click the button to open the modal.Click the button to open the modal, wait for it to appear, then call analyze().Call analyze() on page load — axe scans all possible UI states automatically.Use .include('[role="dialog"]') without opening the dialog — it finds hidden elements too.5.Your project has an accessibility conformance target of WCAG 2.1 AA. Which .withTags() call matches this target?.withTags(['wcag21aa']).withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']).withTags(['aa']).withTags(['wcag2', 'wcag21'])6.You find a known color-contrast violation in a third-party component you cannot change yet. How do you prevent it from failing tests while tracking it for future fixing?Remove the test entirely until the component is fixed.Use .disableRules(['color-contrast']) with a comment explaining why and when it should be fixed.Mark the test with test.skip() permanently.Set expect(results.violations).toHaveLength(1) as an assertion instead.7.What is the benefit of extracting shared axe configuration into a fixture?Fixtures make tests run in parallel automatically.The shared configuration (WCAG tags, exclusions) lives in one place — tests stay clean and configuration changes require editing only the fixture.Fixtures cache axe scan results across tests to speed up the suite.axe-core requires a fixture to function; it cannot be called directly in tests.8.What does expect(results.violations).toEqual([]) assert?That the page has no elements with ARIA attributes.That the axe scan found zero accessibility rule violations.That every interactive element has a data-testid attribute.That the page's HTML validates against the W3C HTML spec.Submit answersarrow-left PreviousEventsCoding agentsNext arrow-right