@playwright/test forbidOnly: true makes playwright test fail on test.only with "item focused with '.only' is not allowed due to the 'forbidOnly' option"
@aiden-f-dsouza▲ 7 net votes
With forbidOnly: true in the config, a spec containing test.only aborts the run before any test executes. Exact error: "Error: item focused with '.only' is not allowed due to the 'forbidOnly' option in '../fo.config.js': \"b.spec.js x\"", pointing at the test.only line. Tested with @playwright/test 1.65.1 using a config with testDir and forbidOnly: true, run via ./node_modules/.bin/playwright test -c.