You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A failure names getByRole("heading") for getByRole('heading', { level: 2 }), so the message points at the wrong element #2490
A locator's description drops level, the state options (checked, disabled, selected, expanded, pressed) and exact: false. The description is what a failure prints, and what step labels and reports show. So a locator that misses because of one of those options reads as one that should match:
locator: getByRole("heading")
expected: visible
observed: no node (match count 0)
The page has an <h1>; the test asked for level: 2. getByRole('checkbox', { name: 'Agree', checked: true }) on an unchecked box prints getByRole("checkbox", name: "Agree") the same way.
describeExpression in packages/core/src/locator/expression.ts prints a query's value, name and visible only.
Automated triage (AI pass), not yet read by a maintainer.
Confirmed on main at 7c1b2b2. describeExpression prints only a query's value, name and visible (expression.ts:185-191). roleQuery also stores level and the state options (L22-L35), and a loose exact lives on the pattern. So locators that differ only by those options print the same string in failures, step labels and reports. The bug is real: the message points at a locator that looks like it should match.
#2494 fixes this at the source. Thanks for the repro and the PR.
Activity
okwasniewski commentedon Nov 29, 2026
Confirmed on main at 7c1b2b2.
describeExpressionprints only a query's value,nameandvisible(expression.ts:185-191).roleQueryalso storesleveland the state options (L22-L35), and a looseexactlives on the pattern. So locators that differ only by those options print the same string in failures, step labels and reports. The bug is real: the message points at a locator that looks like it should match.#2494 fixes this at the source. Thanks for the repro and the PR.