Skip to content

feat(web): read range widgets in toHaveValue - #2061

Closed
Asheesh7298 wants to merge 7 commits into
e2e-inc:mainfrom
Asheesh7298:feat/expect-have-value-widgets
Closed

Asheesh7298 wants to merge 7 commits into
e2e-inc:mainfrom
Asheesh7298:feat/expect-have-value-widgets

Conversation

@Asheesh7298

@Asheesh7298 Asheesh7298 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What and why

  • toHaveValue reads a node's value, but the web reader set one only on native form controls, so an ARIA slider, spinbutton, progressbar, meter, or scrollbar, and a native <progress> or <meter>, could not be asserted on.
  • A locator read now gives those roles their aria-valuetext, else aria-valuenow, skipping a blank one. A native <progress> or <meter> with a value attribute then reads the value its range clamps it to, as Chrome does. A slider or spinbutton with none reads '', as before, any other widget with none has no value, and a stray value attribute on it is not read. A native value is computed from the value, min, and max attributes as HTML clamps them, never through .value, so a page's own getter (a customized built-in <progress is>) never runs; it equals Chrome's .value on 6,510 attribute combinations. Native form controls and editors read as before, a control adopted from another frame included.
  • locator.inputValue() reads the same field, so it returns these values too. Playwright's throws on an ARIA widget. I kept the two paired because the docs describe them together and mobile already works this way. If you'd rather keep inputValue() to form controls, that's a small follow-up here.
  • The agent's tree does not get this value, so what the model reads, the replay cache's evidence, and committed recordings do not change.
  • The MCP locate tool now prints a range widget's value too (value "50"), through the same redaction as any other value.
  • On iOS, nodes already carry an accessibility value outside the form roles (the captured trees show status "In progress" value="1"), so the matcher reads them today. Android drops the value of a non-editable node when it repeats the node's label, so that case uses toHaveText, and the Detox guide says so.
  • Docs: reference/expect.mdx, reference/screen.mdx, the Detox guide (a "Not yet" row now covers only that Android case), and the writing-tests skill line.

Issue

Part of #1855: expect(locator).toHaveValue('On'). @okwasniewski, this is ready for review.

Verified

Ran it locally: yes

  • to-have-value-widgets.test.ts runs the public locator and matcher on a real page: ARIA slider, aria-valuetext, spinbutton, progressbar, <progress>, <meter>, over-max and invalid native values, a blank ARIA value, an editable spinbutton, a native range input that keeps its own value, and widgets with no value that are still refused. It fails on main's web source and passes here.
  • A new case in read-node-checked.test.ts pins that the agent's tree still has no value for a range widget, and one in the mobile locate.test.ts pins the device projection, including the Android label echo.
  • pnpm check, the full pnpm test (8,082 passed), the testbed (598 passed, 3 skipped), and the web suite pass. A hostile-page audit (70 pages, 13 locator reads each) finds no read that works on main and fails here. Each clamp, the attribute parser, and the adopted-control guard fail a test when broken.
  • Not run on a device: no mobile code changed.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.

View guided diff

The web reader set a value only on native form controls, so toHaveValue
could not read an ARIA slider, spinbutton, progressbar, meter, or scrollbar,
or a native progress or meter. A locator read now gives them aria-valuetext,
else aria-valuenow, else the value attribute. The agent tree is unchanged.

Part of e2e-inc#1855.
@github-actions github-actions Bot added the size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 22, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 11 files

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/reference/screen.mdx">

<violation number="1" location="docs/reference/screen.mdx:1054">
P3: This sentence is grammatically incomplete and does not identify which Playwright API throws. Say that Playwright's `inputValue()` throws on an ARIA widget.</violation>
</file>

<file name="docs/reference/expect.mdx">

<violation number="1" location="docs/reference/expect.mdx:203">
P3: The fallback description omits the verb `reads`, making the new value-selection rule incomplete. Add `reads` before `its \`value\``.</violation>

<violation number="2" location="docs/reference/expect.mdx:203">
P2: This describes every native `<progress>` as producing a clamped value, but an indeterminate `<progress>` without a `value` attribute is read as having no value and `toHaveValue` rejects it. Qualify the clamp behavior to valued progress elements and document indeterminate progress separately.</violation>
</file>

<file name="packages/e2e/tests/integration/to-have-value-widgets.test.ts">

<violation number="1" location="packages/e2e/tests/integration/to-have-value-widgets.test.ts:13">
P2: This integration test does not exercise the promised `scrollbar` widget support, so a regression in that role can pass unnoticed. Add a valued scrollbar fixture and assert its `toHaveValue()` result.</violation>
</file>

<file name="packages/web/src/in-page/read-semantics.ts">

<violation number="1" location="packages/web/src/in-page/read-semantics.ts:657">
P2: Generic ARIA range widgets should not use their arbitrary `value` attribute as the current value. Return no value after the ARIA attributes unless the element is a native range control, so widgets without `aria-valuetext`/`aria-valuenow` remain rejected.</violation>
</file>

Comment thread docs/reference/expect.mdx Resolved
Comment thread docs/reference/screen.mdx Resolved
Comment thread docs/reference/expect.mdx Resolved

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Reviewed at ce9e81f (main 5acb822, mergeable_state clean, all checks green). Claimed and assigned on #1855 (expect(locator).toHaveValue('On')), so in scope.

Semantics: Playwright's toHaveValue and inputValue() throw Not an input element on anything but input/textarea/select (checked in playwright-core 1.65.1). Reading aria-valuetext / aria-valuenow on range roles only turns a Playwright throw into a value, so no migrated test changes meaning. It also brings web in line with mobile, which already reports a value for these nodes. Native inputs still read .value first (<input type=range aria-valuetext> reads 30), and the tree projection stays unchanged (rangeValue: false), so model input, cache anchors and recordings stay the same. getByDisplayValue on web still only looks at native fields (VALUED_SELECTOR), so it is not affected. core/types.ts only changes JSDoc, so this adds no new contract and needs no core/e2e peer floor. The web-only patch changeset is right.

Must fix

  • None.

Should fix

  • packages/web/src/in-page/read-semantics.ts:657 return filled('value'): drop this fallback. No accessibility API reports a value attribute as a non-native range widget's value, so the "as Chrome does" comment is not accurate here. On form-like custom elements that attribute is usually the initial value, not the current one: <x-range role="slider" value="20"> dragged to 80 with no aria-valuenow would read 20, a stale value, where today it reads ''. No test covers it (mutant return null passes every test). Return null instead, and drop "and another widget its value attribute" from the changeset and expect.mdx. Same point as cubic's P2 on this line.
  • to-have-value-widgets.test.ts: add an indeterminate <progress aria-label="Busy"> (no value) to the refused cases. Mutant return String(el.value) (indeterminate reads "0") passes today. A valued role="scrollbar" row would also cover the fifth role the docs list (cubic).

Nits

  • docs/reference/expect.mdx:203: "and another widget its value attribute" goes away with the first should-fix. Say "a valued <progress>" so an indeterminate one is clearly the no-value case (cubic).
  • docs/reference/screen.mdx:1054: "Playwright's inputValue() throws on an ARIA widget." (cubic)
  • read-semantics.ts: the file now has two range-value readers, the accname contribution (hasAttribute, matches Playwright's role-name rules) and rangeValueOf (skips blanks, clamps native values). They differ on purpose. A one-line pointer between them would stop someone from "unifying" them later.

Verified

  • Built core/e2e/web from the PR. to-have-value-widgets.test.ts, read-node-checked.test.ts and mobile locate.test.ts pass.
  • @e2e-dev/web integration: 571 passed, 1 skipped. e2e expect-async-value, locator-basics, scripted-reads, scripted-matchers, web-platform: 102 passed.
  • Mutants caught: removing the locator branch (= main), turning rangeValue on in the tree, dropping the blank skip, dropping the meter clamp. Mutants that survived: the value attribute fallback and indeterminate <progress> (see Should fix).

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 22, 2026
kdy1
kdy1 previously requested changes Nov 23, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: Claude Opus 5.5 (claude-opus-5-5), coordinator and drafter, Review Once subagents in T3 Code: GPT-6.2 Astra (gpt-6.2-astra), GPT-6.2 Sol (gpt-6.2-sol), Claude Opus 5.5 (claude-opus-5-5), Claude Sonnet 5.5 (claude-sonnet-5-5)

Requesting changes for one required fix: the value attribute fallback in rangeValueOf (inline comment on read-semantics.ts:657). The other inline comments are optional (P3), and you can do them here or leave them for later.

The core change works. On the base, the slider fixture fails with observed: value "". On this head, it passes. The tree projection still has no value (rangeValue: false), so model input and recordings do not change. getByDisplayValue still reads native fields only.

6 inline comments: 1 required, 5 optional.

Comment thread docs/reference/expect.mdx Resolved
Comment thread docs/reference/screen.mdx Resolved
@github-actions github-actions Bot removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 23, 2026
… the docs

A generic element with a range role but no aria-valuenow/aria-valuetext no
longer reads a stray value attribute; only a native progress or meter reads
a non-aria value, as Chrome reports. The docs qualify the clamp to valued
progress/meter, note an indeterminate progress is refused, name the
Playwright inputValue throw, and drop a verb-less fragment. Adds scrollbar
and indeterminate-progress tests.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/e2e/tests/integration/to-have-value-widgets.test.ts">

<violation number="1" location="packages/e2e/tests/integration/to-have-value-widgets.test.ts:58">
P2: This assertion is unreachable because the preceding unnegated `toHaveValue('')` rejects the test, so the new indeterminate `<progress>` fixture is never exercised. Split the refusal cases into separate expected-failure tests (or otherwise assert each failure independently).</violation>
</file>

@kdy1
kdy1 dismissed their stale review November 23, 2026 07:41

All requested changes are in as of 26a6b97. Checked and dismissed by a T3 Code automation (Claude) for @kdy1.

…e case

A progress or meter adopted from another frame keeps that frame's prototype,
so instanceof missed it. The read now goes by tag. The indeterminate progress
gets its own expected-failure test, since the assertion after a failing one
never ran, and the comment says only the native clamp follows Chrome.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked at 8699035 (main c330373). Every earlier ask is done: the value attribute fallback is gone (only a valued native <progress> / <meter> reads beyond the ARIA attributes), indeterminate <progress> and valued scrollbar have fixtures, the refusals are separate tests so each one runs (cubic's unreachable-assertion P2 was real and is fixed), the read goes by tag so an adopted <progress> clamps, the Chrome comment is narrowed, and both doc wordings are fixed. kdy1's required fix and all five optional ones are in. No regressions in the new commits.

Must fix

  • None.

Should fix

  • to-have-value-widgets.test.ts: nothing pins the dropped fallback. Putting return filled('value') back in place of return null in rangeValueOf still passes every test. Add a refused case like <div role="progressbar" aria-label="Stray" value="20"></div> to the expected-failure titles.

Nits

  • read-semantics.ts rangeValueOf: (el as Element & { readonly value?: unknown }).value can drop the cast. if (!('value' in el) || typeof el.value !== 'number') return null; narrows without one.
  • docs/reference/expect.mdx: "a progressbar with no value" in the last bullet repeats the refused case from the web bullet above it. Keep "a heading, a link".

CI

  • spec at this head: all five test jobs hit the 15 min job timeout while tests were still passing (the last lines are green built-in-overrides.test.ts), so spec gate fails on test cancelled. That is runner slowness, not this PR: other PRs' spec runs this morning were cancelled the same way, and the PR adds one 3s test. Needs a re-run. Everything else is green.

Verified

  • Built core, e2e and web from the PR. to-have-value-widgets.test.ts (e2e), read-node-checked.test.ts (web) and mobile locate.test.ts pass.
  • Mutants caught: indeterminate <progress> reads "0", instanceof in place of the tag check (adopted-frame test fails), no blank skip, aria-valuenow before aria-valuetext, no locator branch (= main). Survived: the value attribute fallback (see Should fix).

@Asheesh7298

Copy link
Copy Markdown
Contributor Author

Added the refused case in 7c8c4d2ca: <div role="progressbar" aria-label="Stray" value="20"> fails toHaveValue with no value (not a form control), and the test fails with filled('value') back. Both nits are in too: the cast is gone, and the last bullet in expect.mdx reads "a heading or a link".

pnpm check and the web suite (969 passed) pass.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@Asheesh7298

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 23, 2026

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked 7c8c4d2. The last ask is done: still refuses a stray value attribute on a range widget pins that a value attribute on role="progressbar" is not read, and the run-level check asserts it fails with no value (not a form control). The read-semantics.ts change only drops a cast ('value' in el narrows it) and keeps the by-tag rule. CI is green (26 success, 4 path-skipped). No new asks; the Ready for Human Review label from /ready stands. Maintainer decision still open: widen inputValue to ARIA range widgets (recommend accept).

@Asheesh7298
Asheesh7298 requested a review from kdy1 November 23, 2026 16:26

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Drafted in Claude Code on T3 by Claude Opus 5.5, with GPT-6.2 Astra, GPT-6.2 Sol and Claude Fable 5.2 as second readers.

Reviewed at 7c8c4d2ca (merge base 3fec41f4b, main). It also merges cleanly onto the current main tip 97b51a229.

The ARIA slider case from #1855 works: on the merge base, toHaveValue('50') on <div role="slider" aria-valuenow="50"> observed value "", and on this head it passes. One thing needs a fix first. The new reader calls a page-defined value getter, and a getter that throws breaks lookups for unrelated fields.

Must fix

  • An exact getByLabel for an unrelated field fails when the page has a custom element with a range role whose value getter throws. I put <label>Email <input value="ada@example.test"></label> next to an <upload-progress role="progressbar" aria-label="Upload"> whose class defines get value() { throw new Error('upload-progress: not ready') }. On this head, await screen.getByLabel('Email', { exact: true }).count() fails with ENGINE_FAILURE: locate failed: locator.elementHandles: Error: upload-progress: not ready. On the merge base the same page returns 1. The exact-label engine reads every [aria-label] element on the page, and rangeValueOf reads el.value before it checks the tag, so the getter runs during a lookup for the Email field. The repo's review notes list in-page code trusting the page as a recurring pattern (.dev/skills/babysit/references/review-triage.md, pattern 5). Please check the tag first, so the reader only reads .value from a native <meter> or a <progress> with a value attribute, and add that custom element next to an Email field to the widget test. read-semantics.ts:667

    One way, tried at 7c8c4d2ca: with this change the Email lookup returns 1 again. Your widget test (the frame-adopted <progress> included) and the tree test still pass.

    const tag = el.tagName.toLowerCase();
    if (tag !== 'meter' && !(tag === 'progress' && el.hasAttribute('value'))) return null;
    if (!('value' in el) || typeof el.value !== 'number') return null;
    return String(el.value);

Optional

  • Your changeset says "A widget with none is refused", which doesn't hold in three cases. A <div role="slider"> or <div role="spinbutton"> with no ARIA value passes toHaveValue(''), and inputValue() returns ''. That's the same as on the merge base, and the docs bullet says so. A <meter> with no value attribute now reads "0", where the merge base refused it. That also contradicts "A valued native <progress> or <meter>" in expect.mdx, since a native meter always has a value: with no value attribute it reads the low end of its range. Suggested changeset sentence: "A slider or spinbutton with none reads '', as before, and any other widget with none, such as an indeterminate <progress>, is refused." In expect.mdx: "A native <meter>, and a <progress> with a value attribute, read the value their range clamps them to." changeset, expect.mdx:233

  • The Android exception is wider than "a text view". nodes.ts drops the value of any non-editable Android node whose value equals its label (android && !editable && value === source.label). The checked-in Android capture shows this on a heading: inventory-header is an android.view.View with label and value both Plain controls, every state exposed, and its projected node has no value. Please say "a non-editable Android node whose value repeats its label" in the Detox row and in expect.mdx. The Android half of "mobile already reads a value outside the form roles" isn't shown either. In the 24 Android captures, every non-editable node with a value has it equal to its label, so none keeps one, and the benchmark app sets no accessibilityValue. Either scope the device sentence to iOS, which the captures do show (status "In progress" value="1"), or attach an emulator run with an accessibilityValue that differs from the label. The edited Detox row also sits under "Planned". detox.mdx:166, expect.mdx:239, nodes.ts:654

  • Can we add three fixture rows for the precedence and blank rules? The head gets all three right when I run them. These mutants pass both new test files: reading a native <progress> or <meter> before its ARIA value, treating a whitespace-only aria-valuetext as filled, and trimming the value it returns. Rows that would catch them:

    • <progress aria-label="Mixed" value="7" max="10" aria-valuenow="70"> reads '70'.
    • aria-valuenow="50" aria-valuetext=" " reads '50'.
    • aria-valuetext=" On " reads ' On '.

    to-have-value-widgets.test.ts:9

Follow-ups

  • An <input type="range" value="30" aria-valuetext="Thirty"> created in a same-origin iframe and appended to the page now reads "Thirty" instead of "30"; the merge base read "". The native-input branch still dispatches on instanceof (read-semantics.ts:1721), so the element falls through to the new range branch. This is the localName follow-up an earlier round already mentioned.

Verified

All runs below are mine, on this machine, at 7c8c4d2ca. I built the merge base 3fec41f4b separately and gave it the same inputs. Each probe ran once per side.

  • Probes through the public matcher:

    merge base this PR
    role="slider" aria-valuenow="50", toHaveValue('50') value "" passes
    <progress value="20" max="10" aria-valuetext="Complete"> refused "Complete"
    <progress value="7" max="10" aria-valuenow="70"> refused "70"
    aria-valuetext=" " aria-valuenow="50" "" "50"
    aria-valuetext=" On " "" " On "
    valueless slider and spinbutton, toHaveValue('') passes passes
    <meter> with no value refused "0"
    getByDisplayValue('3') with an input and a spinbutton both at 3 1 match 1 match
    exact getByLabel('Email') beside a throwing value getter 1 match ENGINE_FAILURE
    range input appended from an iframe "" "Thirty"
  • Suites at 7c8c4d2ca, run here:

    • Green: pnpm check, pnpm test (every package and test:scripts), the testbed (600 passed, 1 skipped), and the web benchmark (95 passed).
    • Flaky: the first pnpm test run had one failure in parallel-workers.test.ts, "keeps the failed attempt before a retry that blocked its worker". It expected exit code 1 and got 3, with a load average of 133 on 18 cores. That test passed when rerun alone on this head and on the merge base, and a full pnpm test rerun at load 27 was green.
    • Web agent suite (from recordings, --strict-cache, no model key): 8 failures, all MODEL_PROVIDER_FAILED on steps with no recording. The same 8 fail on the merge base, and neither side reported REPLAY_STALE, so no recording changed.
  • New tests: 3 added, and each fails under at least one mutant. The widget suite fails under 15 mutants. The tree test fails when the tree projection gets the range value. The mobile test fails when the Android echo is kept. Your widget test is red on the merge base with the expected assertion; the other two pass there, as guards of behavior that didn't change.

  • Mutation testing: 12 places this PR adds or changes a branch in read-semantics.ts, 20 mutants, 16 killed by a failing assertion across the two new web-facing test files. Four survived both files and the whole @e2e-dev/web suite. Three are the precedence and blank cases above. The fourth leaves scrollbar out of the accessible-name path, which this PR only refactored. No mutant failed another way or failed to build.

  • Contract: api-diff between the built merge base and head shows one JSDoc line in core/dist/types.d.ts and no schema, protocol, export or peer change. @e2e-dev/core has no changeset entry, which fits a comment-only change.

Not run

  • Mobile benchmark: no mobile or core runtime source changed, and the benchmark app has no node that could show the Android case. Command: pnpm test:mobile-benchmark.
  • An Android emulator run with an accessibilityValue that differs from the label (see the second optional item).
  • pnpm bench:ab -- tests-agent/control-inventory.e2e.ts --config e2e.agent.config.ts: the machine was too loaded for timings. The tree projection is unchanged and the strict replay matched on both sides.
  • The crosscheck over every benchmark scenario: CROSSCHECK_BENCHMARK_URL=http://127.0.0.1:4280 pnpm --filter @e2e-dev/web exec vitest run tests/integration/crosscheck.test.ts. CI's benchmark gate is green at this head (Source-reported), and the fixture-page crosscheck ran green inside pnpm test.
  • The 8 agent steps that need a model key.

Accepted as intended

  • An ARIA value reads as the author wrote it, not clamped the way Chrome clamps it, so an assertion compares what the app set. A native <progress> or <meter> reads its clamped value.

For the maintainer

  • locator.inputValue() now returns these values too. Playwright's inputValue() throws on an ARIA widget (read in playwright-core 1.65.1, not run). The author offered to keep inputValue() to form controls instead.
  • On the merge base, an ARIA slider or spinbutton with aria-valuenow read '', so toHaveValue('') passed and inputValue() returned ''. It now reads the value. The changeset is a plain patch with no note about that.
  • scrollbar and native <progress> and <meter> go beyond the four roles in the claim on #1855, which asked for "a non-form node with a value".
  • #1869 at f65722e13 reads toBeEmpty from node.value for the slider and spinbutton roles. Once both land, an ARIA slider with aria-valuenow is no longer empty.

The findings are mine; the approval is @okwasniewski's.

@michal-e2e michal-e2e removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 23, 2026
@Asheesh7298

Copy link
Copy Markdown
Contributor Author

Fixed in f22dddeb5: the reader checks the tag and the value attribute before it reads .value, so a generic element's own value getter never runs. Your Email page is now a test: an <upload-progress role="progressbar"> whose getter throws sits next to the field, and the exact getByLabel('Email') finds it and reads its value. The test fails with .value read first.

From your optional list:

  • A <meter> with no value attribute is refused again, as on the merge base. The changeset now says a slider or spinbutton with no value reads '', as before, and any other widget with none is refused. expect.mdx says a native <progress> or <meter> with a value attribute reads the value its range clamps it to.
  • The Android rule now reads "a non-editable Android node whose value repeats its label", in expect.mdx and the Detox row. The row moved from "Planned" to "Not yet". The description now limits the device claim to iOS, which the captures show.
  • The three rows are in: Mixed reads '70', a whitespace-only aria-valuetext falls back to '50', and ' On ' keeps its spaces. Each fails one of your mutants.

Left for the follow-up you listed: the iframe-adopted <input type="range">, which goes through instanceof on main too.

pnpm check, pnpm test (8,082 passed), the web suite (969), and the testbed (598) pass.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 5 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Re-reviewed at f22dddeb5. The Email-field regression is fixed. The tag and attribute checks now happen before the value read, so the unrelated custom progress bar no longer breaks getByLabel('Email', { exact: true }). The new test exercised the exact case that failed at 7c8c4d2ca. The test for a native progress element moved out of an iframe passed too. Reader · Regression test

The release note and matcher docs now describe when a widget without a value returns an empty string or is refused. The Android note also describes the non-editable case accurately. I found no remaining code changes to request in this round. Approval stays with the maintainer.

Before merging: get a green spec gate. Both Node 24 jobs passed the widget regression, then were canceled while the larger test matrix was still running. Their timing matches the workflow's 15-minute limit, though the logs only confirm cancellation. Spec run

Verified locally: build, the widget integration test through the built browser runner, tree projection, and mobile snapshot projection. The current head merges cleanly with main at 97b51a229. This follow-up reran the affected checks. The full repository matrix, mutation sweep, and real-device tests were not repeated locally.

@okwasniewski okwasniewski added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 23, 2026
kdy1
kdy1 previously requested changes Nov 24, 2026

@kdy1 kdy1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This text was drafted with AI and posted after human approval.

  • Harness: T3 Code
  • AI agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: GPT-6.2 Astra (gpt-6.2-astra), reviewer: GPT-6.2 Sol (gpt-6.2-sol), reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)

Verdict: Request changes

This review requests changes. Fix the P2 items before merge. The P3 items are optional and do not block the merge.

The change does what #1855 asks. On the merge base, <div role="slider" aria-valuenow="50"> reads value "". On this head, toHaveValue('50') passes. The tree projection still has no range value, so model input and recordings do not change. I am requesting changes for one problem: the fix in f22dddeb5 does not stop a page's own value getter from running in every case, so an unrelated exact getByLabel can still fail. There is also one non-blocking problem with native inputs that come from another frame.

Reviewed commit: f22dddeb59faec6ca9b15bd82aa0a944ab0646f4

  • P2 (fix before merge): 1 (1 inline)
  • P3 (non-blocking): 1 (1 inline)

Comment on lines +668 to +670
if ((tag !== 'meter' && tag !== 'progress') || !el.hasAttribute('value')) return null;
if (!('value' in el) || typeof el.value !== 'number') return null;
return String(el.value);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · Fix before merge · A customized built-in <progress> or <meter> still runs the page's value getter

The tag check stops an autonomous custom element, but it does not stop a customized built-in. For <progress is="upload-progress" value="1">, the tag is progress, so el.value calls the page's override. An exact getByLabel reads every labelable candidate before it compares labels, so this getter runs during a lookup for an unrelated field.

The page for the probe:

customElements.define('up-a', class extends HTMLProgressElement {
  get value() { throw new Error('upload not ready'); }
}, { extends: 'progress' });
document.body.innerHTML = '<input aria-label="Email" value="ada"><progress is="up-a" aria-label="Upload" value="1" max="10"></progress>';
screen.getByLabel('Email', { exact: true }).inputValue() Result
Merge base 3fec41f4b "ada"
This head f22dddeb5 locate failed: locator.elementHandles: Error: upload not ready

The autonomous <up-b role="progressbar"> from the new test gives "ada" on both sides. A getter that returns a number is a second form of the same problem: for value="20" max="10", a getter that returns a percentage makes the read report "100", not the clamped "10" that expect.mdx documents. The PR description says that a page's own value getter never runs, but that is not true for this case.

const text = (el.textContent ?? '').replace(//g, '');
value = text === '' || (text.trim() === '' && rendered === '\n') ? '' : rendered;
if (projection.textLimit !== null) value = value.slice(0, projection.textLimit);
} else if (projection.rangeValue && RANGE_ROLES.indexOf(implicitRole(el) ?? '') !== -1) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 · Non-blocking · A native input from another frame now reads its ARIA value

Optional. This does not block the merge.

An <input> that is created in a same-origin iframe and then moved into the page keeps the iframe's prototype. Thus el instanceof HTMLInputElement at line 1722 is false, and the element goes into this new range branch. rangeValueOf then returns its aria-valuetext or aria-valuenow, not its value.

getByTestId('t').inputValue() Merge base This head Native value
Moved <input type="number" aria-valuetext="Unset">, empty "" "Unset" ""
Moved <input type="range" value="30" aria-valuetext="Thirty"> "" "Thirty" "30"

The changeset says "Form controls read as before", but the number input changes from a correct value to an incorrect one. The instanceof check is older than this PR, and an earlier review lists it as a follow-up. Thus this problem is non-blocking. rangeValueOf already checks the tag for <progress> for the same reason.

@github-actions github-actions Bot removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 24, 2026
@Asheesh7298

Copy link
Copy Markdown
Contributor Author

@kdy1 Fixed in e1e1fd671: a native <progress> or <meter> now reads its value from the value, min, and max attributes, clamped as HTML clamps them, and never calls .value. Your <progress is="up-a"> page reads "ada" for the exact getByLabel('Email') again. A getter that returns a different number cannot change the result either: value="20" max="10" reads "10". The attribute parse equals Chrome's own .value on 6,510 combinations of value, min, and max, including +5, 5., .5, 70%, 1e39, min above max, and max at or below 0.

Your P3 is in too: a form control adopted from another frame skips the range branch, so the moved <input type="number" aria-valuetext="Unset"> reads "" as on the merge base.

New tests: a throwing and a misreporting customized built-in, the adopted control, and rows for the parser, each clamp, and a slider with no value. Each new rule fails a test when it is broken. A hostile-page audit (70 pages, 13 locator reads each) finds no read that works on main and fails here.

pnpm check, pnpm test (8,082 passed), the web suite, and the testbed (598 passed) pass.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.

View guided diff | Re-trigger cubic

@kdy1
kdy1 dismissed their stale review November 24, 2026 18:17

All requested changes are in as of e1e1fd6. Checked and dismissed by a T3 Code automation (Claude) for @kdy1.

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-checked e1e1fd6 (merge base 3fec41f, main 5711573). kdy1's P2 from 02:33 UTC is fixed: a native <progress> / <meter> value is now computed from its attributes, so a customized built-in's value getter never runs, and getByLabel('Email', { exact: true }) reads "ada" next to a throwing <progress is>. His P3 is fixed too: an input / textarea / select / option adopted from another frame skips the range branch and reads "" as on the merge base. Every earlier ask from our reviews and from michal-e2e is still in place. cubic found nothing at this head.

Must fix

  • Merge conflict with main (mergeable_state: dirty) in packages/web/src/in-page/read-semantics.ts, skills/e2e/references/writing-tests.md and plugins/e2e/skills/e2e/references/writing-tests.md, from #2219 (toBeEmpty). Both sides are needed: keep main's emptyState projection field next to rangeValue, and in the skill keep main's toBeEmpty sentence and "all four", with your "toHaveValue a control's value" wording. Then run pnpm plugins:sync. Web toBeEmpty reads states.empty from emptyOf, not value, so a valued ARIA slider stays empty on the web after the merge, as in Playwright.

Should fix

  • read-semantics.ts:670-683 reimplements the HTML float parser and both clamps (15 lines plus a regex) to avoid a page's getter. A smaller fix gives the same protection: call the built-in getter from the prototype, e.g. Object.getOwnPropertyDescriptor(tag === 'progress' ? HTMLProgressElement.prototype : HTMLMeterElement.prototype, 'value')!.get!.call(el). A subclass override does not affect it, and it works on an element adopted from an iframe. I checked this in Chromium, Firefox and WebKit, and with that swap the whole to-have-value-widgets suite passes, the customized built-in and adopted-frame tests included. It also follows each browser exactly, which the hand parser does not. It matches Chromium on all 1,860 combinations I tried, but differs from Firefox on 163 (Firefox's .value treats trailing text such as value="5 " or "70%" as an error and reads 0, where this reads 5 / 70) and from WebKit on 25 (meter value="1e400"). @e2e-dev/web runs Firefox and WebKit, so in those browsers the matcher would disagree with the page's own .value. With the swap, the parser rows can go (Percent text would read 0 on Firefox), and the clamp rows stay as browser-behavior pins.

Verified

  • Built core, e2e and web from the head. to-have-value-widgets.test.ts (e2e) and read-node-checked.test.ts (web) pass, web tsc --noEmit and oxlint are clean, and the diff adds no new dashes.
  • Mutants, each caught: the adopted-control guard removed, .value in place of the attribute parse (customized built-in test fails), no max <= 0 fallback for <progress>, no min > max fix for <meter>, and an integer-only parser.
  • CI at e1e1fd6 is green: spec gate, mobile, docs, benchmark and build all pass. It ran before main moved, so it needs a re-run after the merge.

@KrzysztofMoch

Copy link
Copy Markdown
Member

🤖 Claude Opus 5.5 responding on behalf of @KrzysztofMoch

Closing in favor of #2242, which carries this branch forward. Your commits are kept with your authorship, rebased onto main past the toBeEmpty conflict, plus one follow-up for the last review: a native <progress> / <meter> now reads through the built-in prototype getter instead of the attribute parser, so the value matches each browser (Firefox reads value="70%" as 0). Thanks for the work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants