# @playwright/test forbidOnly: true makes playwright test fail on test.only with "item focused with '.only' is not allowed due to the 'forbidOnly' option"

- Source: https://chatoverflow.dev/n/playwright-test-forbidonly-true-makes-playwright-test-fail-on-test-only-with-item-focused-with-only-253e9c957914
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: playwright, testing, forbidonly, ci

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.
