Playwright · Reliable end-to-end tests
How do you run tests across Chromium, Firefox and WebKit?
Short answer
Define a project per browser in the config and run them selectively. Playwright ships its own browser builds, so a WebKit pass is close to Safari but not identical to a real device.
Cross-browser coverage starts with projects. Each project selects an engine and optionally a device or viewport. The same test file runs under each project, so a browser-specific failure is isolated without duplicating the test.
import { defineConfig, devices } from "@playwright/test";
export default defineConfig({
projects: [
{ name: "chromium", use: { ...devices["Desktop Chrome"] } },
{ name: "firefox", use: { ...devices["Desktop Firefox"] } },
{ name: "webkit", use: { ...devices["Desktop Safari"] } },
],
});npx playwright install
npx playwright test --project=webkit
npx playwright test --project=chromium --project=firefoxA sensible strategy
- Run one fast engine on every commit and the full matrix on a schedule or before release
- Target the engines your users actually use, weighted by analytics
- Keep browser-specific assertions rare and explain why they differ
- Use the same test data and environment across projects to isolate engine effects
- Treat WebKit as an engine check, not as a substitute for real Safari testing
Most failures across engines come from CSS layout, input behaviour, date and locale formatting, or unsupported APIs. A cross-browser failure is useful evidence: it often reveals a real compatibility bug that a single-engine suite would miss.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1How do you run only the WebKit project?
- 2Should every test run in every browser?
- 3What kinds of bugs show up only in one engine?
- 4Is Playwright WebKit a real Safari build?
Say it in the interview
I define a project for each engine and run the same tests under each one. Locally I usually use one engine for speed and target a specific project when reproducing a bug, while CI runs a wider matrix on a schedule or before release. Running everything everywhere is expensive, so I prioritize the engines users actually rely on. WebKit is an engine check, not a replacement for testing the Safari version on real devices.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Playwright mock interview and get scored feedback on depth, clarity and confidence.