Skip to content

iOS: the XCTest snapshot names a picker wheel Element(39) where the Simulator AX bridge names it PickerWheel (the runner's type table lacks 50 public element types) #4657

Closed

Description

@nstfn

Purpose

The two iOS snapshot producers give one node two different type values. The host AX bridge names every XCUIElement.ElementType raw value. The XCTest runner names 32 of them and publishes the others as Element(<rawValue>). A selector or a consumer that keys on the type works under one backend and fails under the other. The backend is chosen by agent-device per capture (for example, after remote-content-boundary the rest of the app generation uses XCTest), so a caller cannot pin it.

Environment

  • agent-device 0.21.37 for the frames below. Both tables are unchanged at v0.21.39 and on main at 655ede279.
  • macOS 27.2.1, Xcode 27.2, iPhone Simulator iOS 27.2, language fr-FR.
  • App: a production iOS app with a picker wheel in a sign-up form.

Reproduction

The same picker on the same screen, same rect, in two runs of one test case (snapshot --json):

simulator-ax-bridge: {"type": "PickerWheel", "label": null,                   "value": "<field title>", "rect": {"x": 9, "y": 620.5, "width": 384, "height": 253.5}}
apple-runner (tree): {"type": "Element(39)", "label": "<field title>", "value": "<field title>", "rect": {"x": 9, "y": 620.5, "width": 384, "height": 253.5}}

snapshotDiagnostics.stats.backends names the producer of each capture. The label also differs between the two captures of this node.

Cause (source at v0.21.39)

  • RunnerTests+Snapshot.swift:80-117: elementTypeNamesByRawValue holds 30 public cases plus Keyboard and Key; any other raw value becomes Element(<rawValue>). Missing, among others: Group (3), Sheet (5), Alert (7), Dialog (8), PopUpButton (14), StatusBar (25), PageIndicator (34), PickerWheel (39), DatePicker (51), Menu (53), Map (57), Tab (80).
  • snapshot-source/tree.ts:29-113: the bridge names all 83 raw values.
  • The gap is already handled for presenting types only: geometry-policy.ts:444 and SnapshotPresentedSurface.swift:31 read Element(5|7|8) by raw value.

Required behavior

  • Both producers publish the same type name for the same XCUIElement.ElementType raw value.
  • Element(<rawValue>) stays only for a raw value that neither table knows.

Completion conditions

  • A shared fixture (one raw value per public case) gives the same name through the runner table and the bridge table.
  • A UIPickerView captured through XCTest reports type: "PickerWheel".

Dependencies

Blocked by: none. Open decision for the maintainers: callers that match Element(39) today (selectors, kind, #3531) see a rename.

Workaround

Match such nodes by identifier, value or rect, not by type, or accept both PickerWheel and Element(39).

Activity

  1. added
    bug
    in-progress
    on Nov 18, 2026
  2. thymikee commented on Nov 21, 2026

    @thymikee
    Member

    An agent is picking this up; the PR will link here.

  3. removed
    in-progress
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions