arrow-left Back to topicQuizParallelismCheck yourself1.By default, how does Playwright run tests? Which statement is correct?All tests in all files run sequentially in a single processTest files run in parallel across workers; tests within one file run sequentially in the same workerEvery individual test runs in its own worker process2.You have 4 parallel workers and tests that create orders in the database. Without isolation, workers overwrite each other's data. What's the best approach?Set workers: 1 — no parallelism means no isolation problemUse workerIndex to create a separate test user per worker, scoped at the worker levelDelete all test data in afterEach — clean state guarantees isolation3.What happens to a worker after one of its tests fails?The worker pauses and waits for the other workers to finish before restartingThe worker is killed and a fresh worker process starts for the next test — no stale state carries overThe worker continues running remaining tests in the file after logging the failureThe worker retries the failed test immediately before moving on4.How do you enable fully parallel execution so every individual test runs in its own worker?Set workers to a very high number like workers: 100Set fullyParallel: true in defineConfig, or use test.describe.configure({ mode: 'parallel' }) in a specific fileAdd --parallel flag when running npx playwright testSet parallel: true inside each test.describe block5.You want to run tests with exactly 4 workers from the command line without changing the config file. Which command is correct?npx playwright test --workers 4npx playwright test --parallel=4npx playwright test --concurrency 4npx playwright test --threads=46.What is the default number of workers Playwright uses if you do not set workers in the config?1 — sequential by default for stabilityHalf the number of CPU cores on the machineAll available CPU cores — maximum parallelism4 workers regardless of the machine7.You have fullyParallel: true globally but one describe block has tests that share a let orderId variable between them. What will happen?The tests will pass — Playwright automatically synchronises shared variables between parallel testsThe tests will break — each test runs in a separate process, so the shared variable is undefined in tests that depend on itPlaywright will automatically switch that describe block to serial modeThe tests will run sequentially within the describe block even with fullyParallel enabled8.What does test.describe.configure({ mode: 'serial' }) do in the context of parallelism?Forces all tests in the describe block to run in one worker, sequentially, even when fullyParallel is enabled globallyMakes the tests run faster by serialising browser operationsPins those tests to a specific worker index so they always use the same browserEnables serial output in the reporter so test results print one by oneSubmit answersarrow-left PreviousFixturesConfigurationNext arrow-right