Skip to content

test: make the remote-content e2e independent of the simulator locale - #95

Open
subdiox wants to merge 1 commit into
lycorp-jp:mainfrom
subdiox:fix/remote-content-e2e-locale-independence
Open

test: make the remote-content e2e independent of the simulator locale#95
subdiox wants to merge 1 commit into
lycorp-jp:mainfrom
subdiox:fix/remote-content-e2e-locale-independence

Conversation

@subdiox

@subdiox subdiox commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Motivation

RemoteContentRecoveryTests fails on any simulator that is not Chinese or English. It reaches the cross-process document picker with two taps, both matching --label-regex '选取文件|Choose File' — the first on the page's file input, the second on the action sheet iOS puts in between. On a Japanese simulator the picker reads ファイルを選択 and neither tap resolves:

Hint: pattern=--label-regex '选取文件|Choose File'; labels: ... 'Upload test', 'ファイルを選択'

Why not match by identifier

That was the first thing I tried, and neither element has one:

Element AXUniqueId
Safari chrome (for contrast) BackButton, ReloadButton, TabOverviewButton
The page's file input none — WebKit does not surface an HTML id here
The action sheet's options none — system UI

Adding Japanese to the regex would have moved the problem rather than removed it.

Change

The fixture takes ownership of the one label the scene needs:

  • aria-label overrides the browser's localized text for the file input, so the selector is a string this test owns.
  • accept="text/plain" rules out the photo sources, so iOS opens the document picker directly instead of going through the action sheet.

The second tap and the sleep between the two go away with it, and no localized selector is left. The picker is still hosted by a remote process, so the state the test exists to reach — a frontmost tree collapsed to a bare AXApplication, recovered via cross-process discovery and flagged with a remote_content_recovery advisory — is unchanged. Assertions are untouched.

Verification

./scripts/test-runner.sh RemoteContentRecoveryTests passes from a clean build on a Japanese-locale simulator (iOS 26, iPhone 17 Pro), where it fails deterministically on main.

The scene reached the cross-process document picker with two taps that
both matched `--label-regex '选取文件|Choose File'`: the first on the
page's file input, the second on the action sheet iOS puts in between.
Both labels are localized, so the suite fails on any simulator that is
not Chinese or English — on a Japanese one the picker reads
`ファイルを選択`.

Neither element can be matched by identifier. WebKit does not expose an
HTML `id` as an AXUniqueId, and the action sheet's options are system UI
with no identifier at all (Safari's own chrome does have them —
`BackButton`, `ReloadButton` — which is what makes the absence here
easy to misread as a bug in the selector).

Instead the fixture takes ownership of the one label it needs. An
`aria-label` overrides the browser's localized text, and `accept` rules
out the photo sources so iOS opens the document picker directly rather
than through the action sheet. That removes the second tap along with
the last localized selector; the picker is still hosted by a remote
process, which is the state the test exists to reach.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: yuta.ooka <yuta.ooka@lycorp.co.jp>
@subdiox
subdiox marked this pull request as ready for review August 12, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant