Visual & Accessibility Testing Interview Questions for Playwright Testing
31 Visual & Accessibility Testing questions with answers for playwright testing roles — 9 easy, 14 medium, 8 hard.
About Visual & Accessibility Testing
Covers screenshot comparisons with toHaveScreenshot, baselines, thresholds, masking and stable rendering, plus accessibility checks with axe-core, ARIA snapshots, accessible name assertions and keyboard tests. Interviewers ask these to see whether you can catch layout regressions and accessibility gaps without creating a flaky, high-maintenance suite.
What is the difference between toHaveScreenshot and toMatchSnapshot?
Show answer
Why should CSS animations be disabled for visual comparisons?
Show answer
Where does Playwright store baseline screenshots and how are the files named?
Show answer
How do you update screenshot baselines after an intended UI change?
Show answer
Write a test that compares only the pricing card instead of the full page.
Show answer
How do you check colour contrast in Playwright tests?
Show answer
A screenshot test fails with only a few pixels different because of anti-aliasing. What do you do?
Show answer
A screenshot of a search page is flaky because a blinking text cursor appears in the input. How do you fix it?
Show answer
What do maxDiffPixels, maxDiffPixelRatio and threshold control in a screenshot comparison?
Show answer
Write a visual assertion that masks a live clock and an ad banner.
Show answer
Visual tests pass on developers' laptops but fail in CI with tiny font differences. Why, and how do you fix it?
Show answer
How can you apply extra CSS only while a screenshot is taken?
Show answer
Write an accessibility scan that checks only WCAG 2.1 A and AA rules.
Show answer
How do you exclude a third-party widget or switch off one rule in an axe scan?
Show answer
What do toHaveAccessibleName and toHaveAccessibleDescription check?
Show answer
What is an ARIA snapshot and how does toMatchAriaSnapshot work?
Show answer
Write a test that checks keyboard Tab order through a login form.
Show answer
What can automated accessibility tools not catch?
Show answer
How do you attach axe results to the Playwright HTML report?
Show answer
How do you run the same visual tests at mobile, tablet and desktop sizes?
Show answer
Why are screenshot baselines specific to browser and operating system?
Show answer
Tell me about a time an accessibility check caught a real issue before release.
Show answer
Baselines are always rendered in Docker, yet the repo has separate Windows and Linux image files. How do you keep one baseline per browser?
Show answer
A designer changes the primary button colour and 300 visual tests fail at once. How do you handle it?
Show answer
How would you design a visual testing strategy for a large web application?
Show answer
An axe scan reports 40 violations on a legacy page. How do you add accessibility checks without blocking every build?
Show answer
How do you test that a modal dialog traps focus and returns it when closed?
Show answer
Images load lazily and are sometimes missing from full-page screenshots. How do you make them stable?
Show answer
When is visual regression testing a poor fit?
Show answer
Describe how you convinced a team to adopt accessibility testing.
Show answer
Frequently asked questions
How important is Visual & Accessibility Testing in Playwright Testing interviews?
Covers screenshot comparisons with toHaveScreenshot, baselines, thresholds, masking and stable rendering, plus accessibility checks with axe-core, ARIA snapshots, accessible name assertions and keyboard tests. Interviewers ask these to see whether you can catch layout regressions and accessibility gaps without creating a flaky, high-maintenance suite.
How should I use the Visual & Accessibility Testing sheet?
Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.