Cross-Browser and Cross-Platform Testing Questions
Verifying that a product behaves consistently across browsers, browser versions, operating systems, devices, and screen sizes. Covers building a browser and device coverage matrix, prioritizing platforms by real usage telemetry, deciding what to automate versus leave to manual exploratory checks, risk-based sampling between PR, nightly, and pre-release runs with escalation to the full matrix, wiring cross-browser suites into CI with parallel and selective runs, cloud grids versus self-hosted labs (Selenium Grid in Docker, on-prem device labs) versus emulators and simulators, real devices and native mobile apps, sizing infrastructure for large numbers of parallel sessions, running one suite across Chromium, Firefox, and WebKit (Playwright projects, driver factories driven by environment config), headless versus headed differences, feature detection versus user-agent sniffing, browser-specific defects (Safari timing and event ordering, cookie policy and third-party embeds, font and DPI rendering, input and event differences) and how to debug them on physical devices, and OS-level differences (filesystem, encoding, endianness, numeric behavior). Excludes framework and Page Object design, flaky-test management, locator and wait mechanics, and accessibility or visual-diff tooling, which are covered elsewhere.
Your app has shipped a bug where the order in which scheduled callbacks run differs between Safari and Chrome, and users on one engine saw a broken flow. You want an automated check that guards this across browsers and, where relevant, Node. How would you design it so results are deterministic, what would you assert, and how would you stop timing variability from making the check flaky?
Sample Answer
Direct answer
Do not compare absolute timings, and do not assert an order the specifications leave open. Instead, record every callback into a log of labelled events, wait until all expected labels have arrived (a settle barrier driven by a counter, not a sleep), and assert relative order by index in that log. Split the rules into two groups: guarantees every engine must meet (synchronous code first, microtasks before any timer, equal-delay timers in scheduling order, a microtask queued inside a timer callback running before the next timer) and per-engine expectations for orderings the standards leave open (kept as data in a config object). Run the same page in Playwright's Chromium, Firefox and WebKit projects, repeat each test ten times, and keep the check in CI knowing that Playwright's WebKit build is not real Safari.
Why the orders differ
JavaScript runs on one thread with a microtask queue (promise callbacks, queueMicrotask) that drains completely after each running piece of code, and several task queues (timers, message events, rendering callbacks such as requestAnimationFrame) from which the browser's event loop picks the next task. The HTML specification fixes the microtask rules and the order of timers with equal delays, but it does not require any particular order between different task sources, such as a MessageChannel message versus a setTimeout(fn, 0) timer, or where a requestAnimationFrame callback lands relative to timers. Engines choose their own scheduling there. A flow that accidentally depends on such an order works in one engine and breaks in another, which is the reported bug.
Terms the probe uses. A task source is a category of scheduled work (timers, messages, rendering) that the browser keeps in its own queue. MessageChannel creates two linked ports; posting on one port fires a message event on the other as a separate task. requestAnimationFrame asks the browser to call a function just before the next screen repaint. process.nextTick and setImmediate exist only in Node: nextTick runs a callback as soon as the current operation finishes, before the event loop moves on, and setImmediate runs it in the loop's check phase, after the poll phase that handles I/O. A settle barrier is a counter that starts at the number of callbacks scheduled and resolves a promise when the last one has fired.
A five-line example shows the basic order:
// tiny.mjs
console.log('A: synchronous');
setTimeout(() => console.log('D: timer, delay 0'), 0);
Promise.resolve().then(() => console.log('C: promise callback'));
console.log('B: synchronous');
Run in Node 20.18, it prints A, B, C, D in that order. The two synchronous lines finish first (A, B). When the running code ends, the microtask queue drains, so the promise callback runs (C). Only then does the event loop take the next task, the timer (D), although its delay is 0. The HTML specification gives browsers the same rule: microtasks run when the call stack empties, before the next task. The probe below repeats this with more kinds of callback and checks which parts of the order are guaranteed.
What to log and what to assert
The probe schedules the same work in every environment and logs a label when each callback fires:
// probe.mjs
// Runs in a browser page (via page.evaluate) and in Node. Self-contained on purpose.
export function runProbe() {
return new Promise((resolve) => {
const log = [];
let pending = 0;
const track = (label, schedule) => {
pending++;
schedule(() => {
log.push(label);
if (--pending === 0) resolve(log); // settle barrier: every scheduled callback has fired
});
};
log.push('sync-start');
track('micro-promise', (cb) => Promise.resolve().then(cb));
track('micro-queue', (cb) => queueMicrotask(cb));
track('timeout-a0', (cb) => setTimeout(cb, 0));
track('timeout-b0', (cb) => setTimeout(cb, 0));
track('timeout-c10', (cb) => setTimeout(cb, 10));
// Microtask queued from inside a timer callback: must run before the next timer.
track('timeout-d5', (cb) => setTimeout(() => { Promise.resolve().then(() => log.push('micro-in-d5')); cb(); }, 5));
track('timeout-e5', (cb) => setTimeout(cb, 5));
if (typeof MessageChannel !== 'undefined') {
track('message', (cb) => { const ch = new MessageChannel(); ch.port1.onmessage = () => { ch.port1.close(); cb(); }; ch.port2.postMessage(0); });
}
if (typeof requestAnimationFrame === 'function') track('raf', (cb) => requestAnimationFrame(() => cb()));
if (typeof setImmediate === 'function') track('immediate', (cb) => setImmediate(cb));
if (typeof process !== 'undefined' && process.nextTick) track('nexttick', (cb) => process.nextTick(cb));
log.push('sync-end');
});
}
How track(label, schedule) works: schedule is a function that arranges for its argument to be called later ((cb) => setTimeout(cb, 0)). track adds 1 to pending, then passes schedule a wrapper that logs the label, subtracts 1, and resolves the whole promise when pending reaches 0. The test therefore waits exactly as long as the slowest callback and no longer. Labels that a primitive cannot produce (no MessageChannel in some hosts, no setImmediate in browsers) are simply not scheduled, so one probe file runs everywhere.
The rules live in a second file. invariantFailures returns a list of broken rules, so a failure message names the exact rule; ENGINE_RULES holds the allowed message-versus-timer relation per engine:
// invariants.mjs
// Order rules that every engine must satisfy, plus per-engine rules kept as data.
const at = (log, label) => log.indexOf(label);
// Engines may legitimately disagree about message-channel vs zero-delay timer order.
export const ENGINE_RULES = {
chromium: { messageVsTimeout: ['after'] },
firefox: { messageVsTimeout: ['after'] },
webkit: { messageVsTimeout: ['before', 'after'] },
};
export function invariantFailures(log) {
const fails = [];
const need = (ok, msg) => { if (!ok) fails.push(msg); };
const macro = ['timeout-a0', 'timeout-b0', 'timeout-d5', 'timeout-e5', 'timeout-c10'];
need(at(log, 'sync-end') === at(log, 'sync-start') + 1, 'synchronous code must finish before any callback');
for (const m of ['micro-promise', 'micro-queue']) {
need(at(log, m) > at(log, 'sync-end'), `${m} must run after the synchronous code`);
for (const t of macro) need(at(log, m) < at(log, t), `${m} must run before ${t}`);
}
need(at(log, 'micro-promise') < at(log, 'micro-queue'), 'microtasks run in the order they were queued');
need(at(log, 'timeout-a0') < at(log, 'timeout-b0'), 'equal-delay timers run in scheduling order');
need(at(log, 'timeout-d5') < at(log, 'micro-in-d5') && at(log, 'micro-in-d5') < at(log, 'timeout-e5'),
'a microtask queued inside a timer callback runs before the next equal-delay timer');
return fails;
}
export function messageRelation(log) {
return at(log, 'message') < at(log, 'timeout-a0') ? 'before' : 'after';
}
Why these assertions and not others: each guaranteed rule compares two labels by their position in the log, so machine speed cannot change the verdict. The two 5 ms timers (timeout-d5, timeout-e5) share a delay, so their relative order is fixed by scheduling order; the 10 ms timer is deliberately not compared with them, because two timers with different delays can swap when the page stalls between scheduling them. requestAnimationFrame is only required to come after the synchronous code: its slot among timers varies between runs even inside one engine.
Making it deterministic and non-flaky
- Settle barrier, not a sleep. The probe resolves only when its counter reaches zero, so the test never reads the log early and never waits a fixed time. A hung callback fails by the test timeout rather than silently passing.
- Relative order by index. Compare positions in the log, never durations or timestamps.
- Open orders become data. Where engines legitimately differ, the allowed relations sit in
ENGINE_RULES. If WebKit is seen producing both orders across repeated runs, as it is here, its entry allows both; if an engine is stable, pin its single value so a change in either direction is noticed. - Repeat. Ten repeats per engine surface an order that is only usually true. A rule that fails in one repeat out of ten is a real defect or a rule that was never guaranteed, and either way it should not stay in the suite as written.
- Isolate the page. The page is created fresh with
setContent, with no network and no app code, so the check fails only because of scheduling.
The Playwright project runs the same spec in three engines with ten repeats each:
// playwright.config.mjs
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: '.',
testMatch: 'order.spec.mjs',
repeatEach: 10, // repeat each test 10 times in every project
workers: 1, // one page at a time keeps timer pressure comparable
timeout: 15_000,
reporter: 'line',
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
],
});
// order.spec.mjs
import { test, expect } from '@playwright/test';
import { runProbe } from './probe.mjs';
import { ENGINE_RULES, invariantFailures, messageRelation } from './invariants.mjs';
test('scheduling order keeps the guaranteed rules', async ({ page, browserName }) => {
await page.setContent('<!doctype html><title>order</title>');
const log = await page.evaluate(runProbe); // resolves only when every callback has fired
expect(invariantFailures(log), log.join(' > ')).toEqual([]);
// rAF only has to come after the synchronous code; its slot among timers is not asserted.
expect(log.indexOf('raf')).toBeGreaterThan(log.indexOf('sync-end'));
// Engine-specific expectation, read from data rather than hard-coded in the test.
expect(ENGINE_RULES[browserName].messageVsTimeout).toContain(messageRelation(log));
});
The same probe runs in Node, where it also proves the rule set can fail, by feeding it a doctored log in which a timer jumped ahead of a microtask:
// node-run.mjs
import { runProbe } from './probe.mjs';
import { invariantFailures } from './invariants.mjs';
const log = await runProbe();
console.log(log.join(' > '));
console.log('failures:', invariantFailures(log));
// Teeth check: a doctored log where a timer jumped ahead of a microtask must be reported.
const bad = log.filter((l) => l !== 'timeout-a0');
bad.splice(bad.indexOf('micro-promise'), 0, 'timeout-a0');
console.log('doctored log failures:', invariantFailures(bad));
The last four lines of node-run.mjs exist because a rule set that has never failed has not been shown to work. They edit the real log so a timer jumps ahead of a microtask and require invariantFailures to report it.
Worked result
Run in the Playwright 1.48.2 image (Chromium 130.0, Firefox 131.0, WebKit 18.0, Node 20.18, probe loaded as an ES module), node node-run.mjs printed:
sync-start > sync-end > micro-promise > micro-queue > nexttick > immediate > timeout-a0 > timeout-b0 > message > timeout-d5 > micro-in-d5 > timeout-e5 > timeout-c10
failures: []
doctored log failures: [
'micro-promise must run before timeout-a0',
'micro-queue must run before timeout-a0'
]
npx playwright test reported 30 passed (3 engines x 10 repeats) on each of three consecutive invocations. In separate exploratory loops on the same page, the observed logs showed what the config encodes: Chromium and Firefox put message after timeout-a0 in every observed run, WebKit sometimes put message first, and raf appeared at different slots from run to run in all three engines, which is why it has no position rule. Node-only labels (nexttick, immediate) are logged but not asserted; they are absent from the browser rules and their placement relative to promise callbacks is an environment detail the guard does not depend on.
Reading the Node log label by label:
sync-start,sync-end: the probe function runs to its end first; everything else was only queued.micro-promise,micro-queue: the microtask queue drains in the order the callbacks were queued, before any timer.nexttickcomes after the promise callbacks here, which can look backwards becausenextTickis described as running first. Node's documentation explains it: in a CommonJS file the next-tick queue runs before promise callbacks, but an ES module is processed as part of the microtask queue, so Node is already draining microtasks and the promise callbacks go first.probe.mjsis an ES module. The same three lines show both orders:
// ticks.cjs (the same three lines are saved as ticks.mjs)
Promise.resolve().then(() => console.log('promise'));
process.nextTick(() => console.log('nextTick'));
console.log('sync');
Run in Node 20.18, ticks.cjs prints sync, nextTick, promise, and ticks.mjs prints sync, promise, nextTick.
4. immediate precedes timeout-a0. Node's event-loop guide says that when setTimeout(fn, 0) and setImmediate are both called from the main module, the order is non-deterministic and depends on the performance of the process. That is why the probe records immediate and asserts nothing about it.
5. timeout-a0, timeout-b0: equal delays run in scheduling order, a guaranteed rule.
6. message lands between timeout-b0 and timeout-d5. Node delivers message ports through its own machinery, so this slot is a Node detail. The specifications do not order a message task against timers, which is why the browser projects check it against ENGINE_RULES and not against a fixed position.
7. timeout-d5, micro-in-d5, timeout-e5: the d5 callback queued a promise callback, and the microtask queue drains straight after that callback, before the next timer is taken.
8. timeout-c10 is last only because nothing stalled; it is not compared with the 5 ms timers.
If you keep only two rules from this, keep these: synchronous code finishes before any callback, and every queued microtask runs before the next timer or message task. The other assertions follow from the same two ideas.
What the guard does not prove
Playwright's WebKit is a build of the WebKit engine running on Linux, not Safari on iOS or macOS, so it can miss behaviour that comes from Safari's own scheduling or from iOS itself. Keep the production bug as a regression case here (it catches engine-level scheduling), and add a small real-Safari check on a cloud device or a macOS runner for the specific flow that broke, before relying on this alone. Also fix the app: the durable remedy is that the flow stops depending on an order the specifications leave open, for example by chaining promises or awaiting an explicit completion signal instead of racing a timer against a message.
Running the code
# put the files above in an empty folder (ticks.cjs and ticks.mjs hold the same three lines)
echo '{"type":"module"}' > package.json
docker run --rm --ulimit core=0 -v "$PWD":/w -w /w mcr.microsoft.com/playwright:v1.48.2-jammy \
sh -c 'timeout 200 sh -c "npm i --no-audit --no-fund @playwright/test@1.48.2 && node tiny.mjs && node ticks.cjs && node ticks.mjs && node node-run.mjs && npx playwright test"'
Write a Python Selenium driver factory (pseudocode acceptable) that reads environment variables to choose among Chrome, Firefox and a remote Selenium Grid. Requirements: support headless mode via an env flag, allow passing capabilities, and expose a simple API to integrate with pytest fixtures. Describe how you would add mobile emulation or device metrics.
Sample Answer
Direct answer
Put all browser choice in one function, create_driver(env), that reads BROWSER (chrome, firefox or remote), HEADLESS, EXTRA_CAPS (a JSON object of extra capabilities) and MOBILE, builds the browser-specific Options object, and returns a driver. A pytest fixture calls it once per test and quits the driver afterwards. Tests never import a browser class, so switching from a laptop Chrome to a Grid Firefox is an environment change, not a code change.
A capability is a named setting sent to the browser driver when a session starts (browser name, version, platform, vendor extras). Selenium 4 passes them through an Options object (a browser-specific class such as ChromeOptions that collects flags, preferences and capabilities before the session starts); the old desired_capabilities argument is gone. Some capability keys are vendor-prefixed: goog:chromeOptions holds Chrome-only settings and moz:firefoxOptions holds Firefox-only ones, which is where the tests below look for the flags they set.
The factory
# driver_factory.py
"""Environment-driven WebDriver factory for pytest."""
import json
import os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.firefox.options import Options as FirefoxOptions
PHONE = {
"deviceMetrics": {"width": 360, "height": 640, "pixelRatio": 3.0},
"userAgent": ("Mozilla/5.0 (Linux; Android 13; Pixel) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/120.0 Mobile Safari/537.36"),
}
TRUE = {"1", "true", "yes"}
def _build_options(browser, headless, extra_caps, mobile):
if browser == "chrome":
opts = ChromeOptions()
if headless:
opts.add_argument("--headless=new")
if mobile:
emu = {"deviceName": mobile} if mobile != "phone" else PHONE
opts.add_experimental_option("mobileEmulation", emu)
elif browser == "firefox":
opts = FirefoxOptions()
if headless:
opts.add_argument("-headless")
if mobile: # Firefox has no mobileEmulation capability: size + UA only
opts.set_preference("general.useragent.override", PHONE["userAgent"])
else:
raise ValueError(f"unsupported browser: {browser!r}")
for name, value in extra_caps.items():
opts.set_capability(name, value)
return opts
def create_driver(env=None):
env = os.environ if env is None else env
target = env.get("BROWSER", "chrome").lower() # chrome | firefox | remote
headless = env.get("HEADLESS", "0").lower() in TRUE
extra_caps = json.loads(env.get("EXTRA_CAPS", "{}"))
mobile = env.get("MOBILE", "") # "", "phone" or a Chrome device name
if target == "remote":
browser = env.get("REMOTE_BROWSER", "chrome").lower()
opts = _build_options(browser, headless, extra_caps, mobile)
return webdriver.Remote(command_executor=env["GRID_URL"], options=opts)
opts = _build_options(target, headless, extra_caps, mobile)
driver_cls = webdriver.Chrome if target == "chrome" else webdriver.Firefox
driver = driver_cls(options=opts)
if mobile and target == "firefox":
driver.set_window_size(PHONE["deviceMetrics"]["width"], PHONE["deviceMetrics"]["height"])
return driver
# conftest.py
import pytest
from driver_factory import create_driver
@pytest.fixture
def driver():
d = create_driver() # one driver per test: nothing shared between workers or threads
yield d
d.quit()
How the factory reads, top to bottom: create_driver takes a dict of settings (the real environment unless a test passes its own dict), picks the browser, and hands the flags to _build_options, which returns the right Options class. For remote it builds the options for the browser named in REMOTE_BROWSER and sends them to the Grid URL, and the Grid uses them to choose a node. For a local run it starts webdriver.Chrome or webdriver.Firefox directly. The yield in the fixture is pytest's setup-and-teardown form: code before yield builds the driver, the value on the yield line is handed to the test, and the code after yield runs when the test ends, even if it failed.
Choices behind it:
- Headless is a per-browser flag, not one switch. Chrome takes
--headless=new(the form Selenium's Chrome page documents) and Firefox takes-headless(one dash). The factory hides that difference behindHEADLESS=1. Remoteneeds an options object because it is what tells the Grid which browser to start.Options()setsbrowserNamefor you;set_capabilityadds vendor keys such as a build label (use a vendor prefix likeacme:).- Fail fast. An unknown
BROWSERraisesValueErrorbefore any session starts, so a typo in CI is a one-line error, not a hung job. - One driver per test, no globals. The fixture creates and quits its own driver, so there is nothing to share between workers.
Tests for the factory
The tests replace the real browser classes with a Fake, so they need no browser or Grid and finish instantly. Fake records the keyword arguments the factory passed (options, command_executor) so the tests can inspect them. monkeypatch.setattr(webdriver, "Chrome", Fake) swaps the real class for Fake inside the test and puts the original back afterwards. autouse=True applies that fixture to every test in the file without each test naming it. @pytest.mark.parametrize runs one test body once per listed pair, here once for Chrome and once for Firefox. to_capabilities() turns an Options object into the dictionary that would be sent to the browser, which is what the assertions read. The print lines exist so the output below shows the values being checked.
# test_factory.py
import json
from concurrent.futures import ThreadPoolExecutor
import pytest
from selenium import webdriver
import driver_factory
from driver_factory import create_driver
class Fake:
"""Stands in for a browser so the tests need no browser or Grid."""
def __init__(self, **kwargs):
self.kwargs = kwargs
self.size = None
def set_window_size(self, w, h):
self.size = (w, h)
@pytest.fixture(autouse=True)
def fake_browsers(monkeypatch):
monkeypatch.setattr(webdriver, "Chrome", Fake)
monkeypatch.setattr(webdriver, "Firefox", Fake)
monkeypatch.setattr(webdriver, "Remote", Fake)
@pytest.mark.parametrize("browser,flag", [("chrome", "--headless=new"), ("firefox", "-headless")])
def test_headless_flag_per_browser(browser, flag):
d = create_driver({"BROWSER": browser, "HEADLESS": "true"})
caps = d.kwargs["options"].to_capabilities()
args = (caps.get("goog:chromeOptions") or caps["moz:firefoxOptions"])["args"]
print(browser, "args:", args)
assert flag in args
def test_remote_uses_url_browser_and_extra_caps():
env = {"BROWSER": "remote", "REMOTE_BROWSER": "firefox", "GRID_URL": "http://grid:4444",
"EXTRA_CAPS": json.dumps({"acme:build": "ci-42"})}
d = create_driver(env)
caps = d.kwargs["options"].to_capabilities()
print("remote:", d.kwargs["command_executor"], caps["browserName"], caps["acme:build"])
assert d.kwargs["command_executor"] == "http://grid:4444"
assert caps["browserName"] == "firefox" and caps["acme:build"] == "ci-42"
def test_chrome_mobile_emulation_metrics():
d = create_driver({"BROWSER": "chrome", "MOBILE": "phone"})
emu = d.kwargs["options"].to_capabilities()["goog:chromeOptions"]["mobileEmulation"]
print("chrome emulation:", emu["deviceMetrics"])
assert emu["deviceMetrics"] == {"width": 360, "height": 640, "pixelRatio": 3.0}
def test_firefox_mobile_is_size_and_user_agent_only():
d = create_driver({"BROWSER": "firefox", "MOBILE": "phone"})
prefs = d.kwargs["options"].to_capabilities()["moz:firefoxOptions"]["prefs"]
print("firefox size:", d.size, "ua pref set:", "general.useragent.override" in prefs)
assert d.size == (360, 640) and "general.useragent.override" in prefs
def test_unknown_browser_fails_fast():
with pytest.raises(ValueError):
create_driver({"BROWSER": "netscape"})
def test_parallel_threads_get_distinct_drivers():
with ThreadPoolExecutor(max_workers=8) as pool:
drivers = list(pool.map(lambda _: create_driver({"BROWSER": "chrome"}), range(8)))
print("distinct drivers:", len({id(d) for d in drivers}))
assert len({id(d) for d in drivers}) == 8
Run in a python:3.12-slim container with selenium 4.25.0 and pytest 8.3.3 using the command in the last section, it prints the following. The dots are pytest's progress marks, which -s leaves mixed into the print lines, and the elapsed time varies from run to run:
chrome args: ['--headless=new']
.firefox args: ['-headless']
.remote: http://grid:4444 firefox ci-42
.chrome emulation: {'width': 360, 'height': 640, 'pixelRatio': 3.0}
.firefox size: (360, 640) ua pref set: True
..distinct drivers: 8
.
7 passed in 0.01s
The seven tests are the two headless cases, remote, Chrome mobile, Firefox mobile, the unknown-browser error and the thread test.
Mobile emulation and device metrics
Device metrics are the screen width, height and pixel ratio (physical pixels per CSS pixel) a page sees. ChromeDriver's mobileEmulation capability accepts two forms, both documented on developer.chrome.com:
| Form | Example | Use when |
|---|---|---|
| Named device | {"deviceName": "Nexus 5"} | the name exists in DevTools' emulated-device list, otherwise ChromeDriver errors |
| Explicit metrics | deviceMetrics (width, height, pixelRatio required; touch defaults to true) plus userAgent and optional clientHints | you need a size the list lacks, or stable values that do not change when Chrome updates its list |
The factory uses the explicit form for MOBILE=phone and passes any other MOBILE value as a deviceName.
Limits to state out loud: mobileEmulation is a ChromeDriver capability, so it exists only for Chrome-family browsers. Firefox gets a window resize plus a user-agent override, which changes layout width and what the server sees but not touch events or pixel ratio. Emulation also runs desktop Chrome with a phone-shaped viewport; it is not an Android device and it is not iOS Safari. For engine-level mobile coverage (WebKit, real Safari) use a device cloud or real devices, and decide which pages need it from your traffic data.
Parallel runs and parameterised runs in pytest, and the TestNG equivalents
TestNG is the most widely used Java test framework, and many Selenium teams come from it. If you only use Python, read the left column as what the Java world does for the same two jobs: feeding several browsers into one test (a data provider is TestNG's way of supplying parameter rows) and keeping parallel tests from sharing one driver (ThreadLocal<WebDriver> gives each thread its own private copy of a variable, and testng.xml is TestNG's run configuration file). pytest-xdist is a pytest plugin that runs tests in several worker processes, started with -n, for example -n 4 for four workers.
| TestNG (Java) | pytest equivalent |
|---|---|
@DataProvider feeding browsers into a test | @pytest.mark.parametrize("browser", [...]) or a parametrised fixture that sets BROWSER |
ThreadLocal<WebDriver> so parallel methods on one instance do not share a driver | not needed with a function-scoped fixture: each test builds its own local driver. If tests run in threads and you do keep a module-level driver, wrap it in threading.local() |
parallel="methods" with thread-count in testng.xml | pytest -n 4 with the pytest-xdist plugin (separate worker processes, so no shared driver by construction) |
@DataProvider(parallel = true) (default pool of 10 threads, data-provider-thread-count to change it) | parametrised tests spread across xdist workers |
TestNG's parallel accepts methods, tests, classes or instances and thread-count sets the pool size (TestNG documentation). ThreadLocal exists in Java because TestNG runs methods of one class instance on several threads; the test in the code above proves the equivalent guarantee here: eight threads calling the factory get eight distinct drivers.
Trade-offs and pitfalls
- Pin Selenium, and name the browser version when it matters. A Grid image decides its own browser version, so set
browserVersioninEXTRA_CAPS(a standard capability) when a test depends on it. - Always
quit(), notclose().close()shuts one window; a leaked session keeps a Grid slot until its timeout and starves other jobs. - Do not read
os.environdeep inside page objects. Reading it once in the factory keeps tests deterministic and lets unit tests pass a plain dict, as above. - Headless can differ from headed (window size defaults, GPU paths, some permission prompts). Set an explicit window size, and run a headed smoke job nightly.
Running the code
# put driver_factory.py, conftest.py and test_factory.py in one folder, then:
docker run --rm --ulimit core=0 -v "$PWD":/w -w /w python:3.12-slim sh -c \
'pip install -q selenium==4.25.0 pytest==8.3.3 && timeout 100 python -m pytest -q -s -p no:cacheprovider'
# real use, e.g. a Grid Firefox in headless mode:
BROWSER=remote REMOTE_BROWSER=firefox GRID_URL=http://localhost:4444 HEADLESS=1 pytest
Compare running browser tests in containers with Selenium Grid in Docker against using a cloud device farm. Cover reproducibility, parallelisation limits, access to GPUs and real devices, execution latency, CI integration effort and maintenance overhead. Which would you recommend for a small startup and why?
Sample Answer
Direct answer
For a small startup, run browser tests in containers on every PR and rent a cloud device farm for the small set of checks that need real Safari or real phones. If the suite is already written in Selenium, a Selenium Grid in Docker is the container half of that answer; if it is not, use Playwright's own browsers in the same containers and skip the Grid. The reason is cost shape: containers use CI capacity you already pay for and give the fast, reproducible feedback a PR needs, while the one thing containers cannot do is run real Safari or a real device, and a startup should not buy or maintain hardware to cover that small slice. Choose the farm alone only if nobody on the team has time to maintain any test infrastructure at all.
Terms. A container is a lightweight, isolated package of an application and everything it needs, started from an image. Selenium Grid is a server that receives WebDriver commands (the standard remote-control protocol for browsers) and routes each test session to a browser on one of several machines (nodes). In its dynamic mode the Grid starts a fresh container for each session and removes it afterwards. A session is one browser opened by one test, so concurrent sessions are tests running at the same moment. Capabilities are the key-value settings a test sends to say which browser, version and operating system it wants. Docker Compose files are YAML files that describe several containers and how they connect, and Kubernetes is a system that schedules containers across many machines. A cloud device farm is a hosted service that rents real or virtual browsers and phones by the minute or by parallel-session count. Real devices are physical phones.
Comparison
| Axis | Selenium Grid in Docker | Cloud device farm |
|---|---|---|
| Reproducibility | High: the same pinned image runs on a laptop and in CI, so a failure can be replayed locally | Medium: the vendor controls OS and browser patch levels, and updates land on the vendor's schedule; record the version in every report |
| Parallelisation limits | Bounded by your CI machines: plan about 1 CPU per browser container, and the Selenium Docker project adds about 1 more CPU per video-recording container; scale by adding nodes | Bounded by the number of concurrent sessions your plan buys; scaling is a plan change, not an infrastructure task |
| GPUs and real devices | Containers run in headless or virtual-display setups on server CPUs; no real GPU or phone unless you build a lab. The Selenium Docker project publishes Chrome, Firefox and Edge images and its page does not mention Safari, so real Safari is out of reach | Real iPhones, Android phones and macOS Safari are available, which is the main reason to pay |
| Execution latency | Low to start a session (local network, containers close to the code); the dynamic Grid starts a container per session | Higher: a session queue, a network hop to the vendor and a device or VM allocation add time to every session, and the effect is larger the smaller the test |
| CI integration effort | Moderate: write compose or Kubernetes files, size the nodes, set shm_size (the size of the container's shared memory; the project's quick start uses --shm-size=2g per browser container so Chrome does not crash), add video and log collection | Low: point the test at the vendor's remote URL with credentials and capabilities; the vendor supplies video, logs and screenshots |
| Maintenance overhead | Yours: image upgrades, node scaling, cleanup of leaked containers, grid health | The vendor's: new devices and browsers appear without you; you maintain keys, plan sizing, and test-reporting integration |
Recommendation and costs
- Every PR: containerised Chromium and Firefox, plus Playwright's WebKit build if you use Playwright (it is not a Selenium Grid option). That is the fast, deterministic gate, and it costs CI minutes only.
- Nightly and pre-release: a small cloud plan (a few concurrent sessions) running the smoke subset on real Safari on macOS and one real iPhone and one real Android phone. The point is the hardware-only defects, not volume.
- Reassess when: the monthly farm bill exceeds the cost of owning and maintaining a few devices (include the engineer-hours; a lab usually loses for a startup), or the farm's queue time starts to slow releases. Move more of the farm's work into containers if the defects it finds turn out to be reproducible there.
Cost model, showing the break-even shape: let P be the farm plan price per month, c the CI price per hour, h the hours of Grid-backed CI per month, and m the monthly cost of the engineer-hours spent maintaining the Grid. Containers are cheaper than the farm while c x h + m < P.
Worked example with assumed inputs (not vendor quotes): a farm plan with enough concurrent sessions to run the PR suite costs P = 1,200 per month; the CI machines cost c = 1 per hour and run h = 200 hours; maintaining the Grid takes 5 engineer-hours at 60 per hour, so m = 300. Then c x h + m = 200 + 300 = 500, below 1,200, so containers win. If upkeep grows to 20 hours, m = 1,200 and the total is 200 + 1,200 = 1,400, above 1,200, so the farm wins. The break-even upkeep is (1,200 - 200) / 60, about 16.7 hours a month. For a small team m (an engineer's time) tends to dominate, so the usual pattern is containers for volume and a small paid farm for fidelity, not a larger self-hosted Grid.
Pitfalls
- Running every test on the farm: the latency and per-minute cost make PR feedback slow and expensive.
- Expecting Docker to cover Safari: it covers Chromium-based and Gecko-based browsers; Playwright WebKit in Docker is an engine proxy and not iOS or macOS Safari.
- A Grid without video and logs: a failure in a remote container is hard to diagnose; budget storage for artifacts. Note that the Selenium Docker project says video recording is not supported for headless browsers.
- Not pinning image versions, which gives up the reproducibility that was the reason to use containers.
Playwright supports multiple browsers. Describe a cross-browser testing strategy with it that minimises duplicate tests while still covering browser-specific behaviour. How do you parameterise tests and manage browser-specific fixtures or capabilities?
Sample Answer
Direct answer
Write each test once, in one set of files, and let Playwright projects decide where it runs. A project is a named configuration (here one per browser engine) that runs the suite with its own settings. Chromium runs everything; Firefox and WebKit run only the tests tagged as engine-sensitive, because app logic that does not touch the browser engine gives the same answer everywhere. Handle browser differences by feature detection inside a fixture (a fixture is a reusable setup value a test asks for by name), and reserve per-browser branches for the few cases where the difference is the thing under test.
Projects and tags decide where a test runs
// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';
// Chromium runs every test. Firefox and WebKit run only tests tagged @engine,
// the ones whose result depends on the browser engine rather than app logic.
const engineOnly = /@engine/;
export default defineConfig({
testDir: './tests',
fullyParallel: true,
reporter: 'list',
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] }, grep: engineOnly },
{ name: 'webkit', use: { ...devices['Desktop Safari'] }, grep: engineOnly },
],
});
- No duplicated tests. The same
tests/directory feeds all three projects. A device descriptor such asdevices['Desktop Firefox']is a ready-made bundle of settings (viewport size, user agent, touch support) that makes a project behave like that device. Tests are not copied per browser. - Engine-sensitive means layout, form controls, storage, input handling, media and any API that engines implement separately. Pure logic (price formatting, reducers) is tagged
@logicand runs on Chromium only. - Per-project filters.
grepon a project limits that project to matching tests. A command-line--grepis applied on top: with this config,--project=firefox --grep "@logic"lists 0 tests and--project=chromium --grep "@logic"lists 1. - Browser-specific capabilities live in the project's
useblock, for example a branded Edge build withchannel: 'msedge'(documented for projects), a mobile project built from a device descriptor with touch enabled, or a differentbaseURLper environment. Keep these out of test bodies.
Fixtures: detect features, do not sniff browsers
// tests/fixtures.ts
import { test as base } from '@playwright/test';
type Caps = { hasDialog: boolean; hasContainerQueries: boolean };
// Feature detection in the page under test, never a check of browserName for logic.
export const test = base.extend<{ caps: Caps }>({
caps: async ({ page }, use) => {
await page.setContent('<p>probe</p>');
const caps = await page.evaluate(() => ({
hasDialog: typeof HTMLDialogElement === 'function',
hasContainerQueries: CSS.supports('container-type: inline-size'),
}));
await use(caps);
},
});
export { expect } from '@playwright/test';
A fixture runs the probe inside the page under test, so a test says "skip when the page cannot do this" and the reason is the missing feature, not the browser's name. A skip keyed on browserName goes stale when an engine ships the feature; a skip keyed on CSS.supports or typeof HTMLDialogElement heals itself. Keep a skip report in CI so a feature that silently disappears from every engine does not turn the whole row into a skip.
Parameterised tests
// tests/cart.spec.ts
import { test, expect } from './fixtures';
const money = (cents: number) => `$${(cents / 100).toFixed(2)}`;
test('@logic totals format as dollars', () => {
expect(money(1999)).toBe('$19.99');
});
// Assigning an impossible calendar date to a date input must leave it empty.
for (const [value, expected] of [['2026-02-29', ''], ['2026-02-28', '2026-02-28']]) {
test(`@engine date input sanitises ${value}`, async ({ page }) => {
await page.setContent('<input id="d" type="date">');
await page.$eval('#d', (el: HTMLInputElement, v) => { el.value = v; }, value);
expect(await page.inputValue('#d')).toBe(expected);
});
}
test('@engine dialog opens modally when supported', async ({ page, caps }) => {
test.skip(!caps.hasDialog, 'no <dialog> in this engine');
await page.setContent('<dialog id="m">hi</dialog>');
await page.$eval('#m', (d: HTMLDialogElement) => d.showModal());
expect(await page.$eval('#m', (d: HTMLDialogElement) => d.open)).toBe(true);
});
test('@engine container query narrows the card', async ({ page, caps }) => {
test.skip(!caps.hasContainerQueries, 'container queries unsupported');
await page.setContent(`<style>
body{margin:0} #w{container-type:inline-size;width:300px}
#c{width:100%} @container (max-width:400px){#c{width:50%}}
</style><div id="w"><div id="c">x</div></div>`);
expect(await page.$eval('#c', (e) => e.getBoundingClientRect().width)).toBe(150);
});
Reading the three listings line by line: in the fixture, base.extend<{ caps: Caps }> declares a new fixture called caps; the code before await use(caps) is setup, the value passed to use is what the test receives, and anything after it would run as teardown. page.evaluate runs the probe inside the browser page and returns the results. In the spec, page.$eval('#d', fn, value) runs fn inside the page on the first element matching #d, with value passed as its second argument, here assigning it to the date input. 2026-02-29 must give '' because 2026 is not a leap year, so that date does not exist and the browser sanitises the assigned value to an empty string. <dialog> is the HTML element for a dialog box, and showModal() opens it modally, meaning the rest of the page is blocked while it is open. test.skip(!caps.hasDialog, reason) ends the test as skipped when the probe found no support. In the container-query test, #w is a 300px-wide container, and the rule @container (max-width:400px) applies when that container is at most 400px wide, so #c becomes 50% of its container's width: 300 x 0.5 = 150.
The for loop over [value, expected] pairs generates one test per data row, so the date-input check is written once and runs twice per engine. The same loop can take a list of viewports or locales.
Run it
Run in the Playwright 1.48.2 image (Chromium 130, Firefox 131, WebKit 18.0, Linux), the per-project test counts were:
chromium: Total: 5 tests in 1 file
firefox: Total: 4 tests in 1 file
webkit: Total: 4 tests in 1 file
npx playwright test then printed 13 passed (5 + 4 + 4), and npx playwright test --repeat-each=10 printed 130 passed, with no failures or skips across those repeats. Running everything on every engine would be 5 x 3 = 15 executions; the tag split saves 2 here.
Why this scales
With the suite sizes of a real product the saving is larger. For 200 tests of which 60 are engine-sensitive, the split runs 140 + 60 x 3 = 320 executions against 200 x 3 = 600 for everything everywhere, which is 46.7 percent fewer.
Trade-offs and pitfalls
- Mis-tagging. A test that depends on the engine but carries
@logicnever runs on Firefox or WebKit. Review the tag in code review, and when a bug escapes on a non-Chromium browser, add the tag to the test that should have caught it. - Playwright WebKit is not Safari. It tracks WebKit main and runs on Linux here, so it cannot show iOS-specific behaviour (touch handling, on-screen keyboard, iOS storage rules). Keep a real-device row for those.
- Do not hide real divergence. If a behaviour is meant to differ per browser, test the expected difference with an explicit per-browser assertion and a comment saying why; do not skip.
Running the code
# in an empty directory with package.json {"type":"module","devDependencies":{"@playwright/test":"1.48.2"}}
# files: playwright.config.ts, tests/fixtures.ts, tests/cart.spec.ts (as above)
docker run --rm --ulimit core=0 -v "$PWD":/src:ro \
mcr.microsoft.com/playwright:v1.48.2-jammy sh -c \
'cp -r /src /w && cd /w && npm i @playwright/test@1.48.2 && \
npx playwright test --project=firefox --list && \
npx playwright test && npx playwright test --repeat-each=10'
Describe how to integrate a cross-browser test suite into a CI/CD pipeline for PR gating that supports parallel execution and selective test runs based on changed code paths. Include a high-level example workflow in a common CI system such as GitHub Actions, and explain how you would shard tests across runners to minimise PR latency.
Sample Answer
Direct answer
Gate pull requests (PRs) with one required check (a check that branch protection, the repository setting that blocks merging until named checks pass, must see succeed) backed by a pipeline of four stages: a cheap "select" job that maps the changed files to test tags, a matrix of parallel jobs that each run one shard (a fixed slice) of the Playwright suite in a pinned browser image, a merge job that combines the per-shard reports (each shard writes a blob report, a compact raw results file that can be merged into one HTML report later), and a single gate job that is the only check branch protection names. Run engine-sensitive tests on Chromium, Firefox and WebKit and everything else on Chromium only; choose the shard count from the latency budget with the arithmetic below, not by guessing.
Selective runs from changed code paths
Playwright's --only-changed[=ref] flag runs test files that changed between HEAD and a git ref (git only, per the CLI docs). It selects changed test files, not tests affected by changed source files, so a change to src/checkout/ with no test edit would run nothing. Map source paths to tags instead, and pass the tags to --grep:
// select-tags.mjs
// Reads changed file paths (one per line) on stdin and prints one line for
// $GITHUB_OUTPUT: grep=<regex for npx playwright test --grep>.
import { readFileSync } from 'node:fs';
const rules = [
[/^src\/checkout\//, '@checkout'],
[/^src\/search\//, '@search'],
[/^src\/account\//, '@account'],
[/\.(md|png|svg)$|^docs\//, null], // no effect on behaviour
];
const runAll = /^(package(-lock)?\.json|playwright\.config\.ts|tests\/|src\/shared\/)/;
const files = readFileSync(0, 'utf8').split('\n').filter(Boolean);
const tags = new Set(['@smoke']);
let all = false;
let relevant = 0;
for (const f of files) {
if (runAll.test(f)) { all = true; continue; }
const rule = rules.find(([re]) => re.test(f));
if (rule && rule[1] === null) continue;
relevant++;
if (rule) tags.add(rule[1]); else all = true; // unknown path: be safe
}
console.log('grep=' + (all ? '.' : relevant === 0 ? 'NONE' : [...tags].join('|')));
Run in the Playwright 1.48.2 image it prints grep=@smoke|@checkout for src/checkout/cart.ts plus README.md, grep=. (run everything) for src/shared/format.ts, grep=NONE for only docs/a.md and logo.png, and grep=. for the unmapped src/legacy/x.ts. The safe default is "run everything" for shared code, test code, config, lockfiles and unknown paths: a wrong skip lets a bug through, a wrong full run only costs minutes.
A Playwright project is a named browser configuration in playwright.config.ts, and it can carry its own grep filter (for example Firefox and WebKit run only @engine tests). A command-line --grep is applied on top of it: with the project filters from a three-project config, --project=firefox --grep "@logic" listed 0 tests while --project=chromium --grep "@logic" listed 1. So a Firefox or WebKit run of a changed area needs the test to carry both the area tag and @engine.
The GitHub Actions workflow
name: e2e-pr
on: pull_request
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
select:
runs-on: ubuntu-latest
outputs:
grep: ${{ steps.pick.outputs.grep }}
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- id: pick
shell: bash
run: git diff --name-only origin/${{ github.base_ref }}...HEAD | node ci/select-tags.mjs >> "$GITHUB_OUTPUT"
e2e:
needs: select
if: needs.select.outputs.grep != 'NONE'
runs-on: ubuntu-latest
container: mcr.microsoft.com/playwright:v1.48.2-jammy
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx playwright test --shard=${{ matrix.shard }}/8 --grep "${{ needs.select.outputs.grep }}"
env: { CI: "true" }
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: blob-report-${{ matrix.shard }}
path: blob-report
retention-days: 1
merge-reports:
needs: e2e
if: ${{ !cancelled() && needs.e2e.result != 'skipped' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- uses: actions/download-artifact@v5
with: { path: all-blob-reports, pattern: blob-report-*, merge-multiple: true }
- run: npx playwright merge-reports --reporter html ./all-blob-reports
- uses: actions/upload-artifact@v4
with: { name: playwright-report, path: playwright-report, retention-days: 14 }
gate:
needs: [select, e2e]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
test "${{ needs.select.result }}" = "success"
test "${{ needs.e2e.result }}" = "success" -o "${{ needs.e2e.result }}" = "skipped"
How to read the workflow. concurrency with cancel-in-progress: true means a newer push to the same branch cancels the older run. fetch-depth: 0 makes checkout fetch the full git history (the default is a single commit, which would leave nothing to diff against). git diff --name-only origin/BASE...HEAD with three dots compares HEAD with the point where the branch left the base branch, so it lists only the files this PR changed, not files that landed on the base branch since. Appending grep=... to $GITHUB_OUTPUT (a file the runner reads) turns that line into the step output steps.pick.outputs.grep, which the select job passes on as needs.select.outputs.grep. shell: bash matters: a step with no shell runs bash -e, which has no pipefail, so if git diff failed (for example the base ref could not be resolved) the pipe would still succeed, the selector would read an empty list and print NONE, e2e would be skipped and the gate would pass with no tests run; the explicit bash shell runs bash -eo pipefail, so the failed git diff fails the step, and with it select and the gate. needs: select makes e2e wait for it, and the if: skips e2e entirely when the selector printed NONE. fail-fast: false lets the other shards finish when one fails, so you see every failure at once. needs.e2e.result is one of success, failure, cancelled or skipped, and if: always() makes the gate job run even when e2e failed or was skipped, which a job otherwise would not. The gate's first shell line requires select to have succeeded, because a failed select makes e2e skip and a skip alone must never read as a pass. Its second line, test A = success -o A = skipped, exits 0 (job passes) only if the e2e result is one of those two; GitHub runs multi-line run blocks with bash -e, so either line failing fails the job.
How to read select-tags.mjs. readFileSync(0, 'utf8') reads standard input (file descriptor 0), which is the piped list of changed paths. runAll is a regular expression for paths whose change could affect any test (lockfile, config, the tests themselves, shared code), and any match sets all. rules.find(([re]) => re.test(f)) returns the first [regex, tag] pair whose regex matches the path f; a null tag means the path cannot change behaviour and is ignored, no pair at all means an unknown path, which also sets all. The final console.log prints . (a regex that matches every test title) for run-everything, NONE for nothing relevant, and otherwise the tags joined by | into a regex such as @smoke|@checkout.
The config sets reporter: process.env.CI ? 'blob' : 'list' and fullyParallel: true. The Playwright docs recommend blob reports for sharded CI and fullyParallel so that shards split by test and not by file; without it, shards split by file and uneven file sizes leave some shards with far more tests. The gate job gives branch protection a single stable name, and treats a skipped e2e (documentation-only change) as a pass only when select succeeded. The container: image pins the browser builds to the Playwright version, and concurrency cancels a superseded run when a new commit is pushed.
Choosing the shard count
A shard is one of N slices of the suite run by its own CI job, and a worker is a parallel test process inside that job. Per-shard latency is roughly total test work divided by (shards x workers per job), plus fixed per-job overhead. Illustrative assumptions (ESTIMATE, replace with your measured values): 200 tests of which 60 are engine-sensitive, so 140 + 60 x 3 = 320 test executions; 15 s average per execution (4,800 s of work); 2 workers per job; 90 s of checkout, install and browser start-up per job.
One row worked out, 7 shards: latency = 4,800 / (7 x 2) + 90 = 342.9 + 90 = 432.9 s, shown as 433; runner minutes = 7 x 432.9 / 60 = 50.5.
| Shards | Latency (s) | Runner minutes |
|---|---|---|
| 1 | 2,490 | 41.5 |
| 4 | 690 | 46.0 |
| 7 | 433 | 50.5 |
| 8 | 390 | 52.0 |
| 16 | 240 | 64.0 |
For a 7-minute (420 s) PR budget, 7 shards miss it (433 s) and 8 shards meet it (390 s), at about 25 percent more runner minutes than a single job (52.0 against 41.5). The overhead term is why returns diminish: going from 8 to 16 shards saves 150 s (390 to 240) and costs 12 more runner minutes (52.0 to 64.0). Re-fit the numbers from the merged report's per-test durations once it exists.
Trade-offs and pitfalls
- A flaky test blocks every PR. Set
retries: 1in CI so one transient failure does not fail a shard, and track tests that needed a retry. - Tag drift: a new directory with no rule falls through to "run everything", which is safe and visible in the select job log.
- Playwright WebKit on Linux is not iOS Safari; keep real-device runs nightly.
Running the code
npm i @playwright/test@1.48.2
printf 'src/checkout/cart.ts\nREADME.md\n' | node select-tags.mjs
CI=true npx playwright test --shard=1/8 --list
npx playwright test --project=firefox --grep "@logic" --list
With this minimal playwright.config.ts and a tests/a.spec.ts holding two tests named totals @logic and layout @engine:
import { defineConfig } from '@playwright/test';
export default defineConfig({
fullyParallel: true,
reporter: process.env.CI ? 'blob' : 'list',
retries: process.env.CI ? 1 : 0,
projects: [
{ name: 'chromium', use: { browserName: 'chromium' } },
{ name: 'firefox', use: { browserName: 'firefox' }, grep: /@engine/ },
{ name: 'webkit', use: { browserName: 'webkit' }, grep: /@engine/ },
],
});
the Firefox command prints Error: No tests found and exits 1, while the same command with --project=chromium lists totals @logic. Run inside mcr.microsoft.com/playwright:v1.48.2-jammy with --rm.
Unlock Full Question Bank
Get access to all 24 Cross-Browser and Cross-Platform Testing interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.