Repository navigation
Strip the XCUIElementType prefix when normalizing mobile node kinds (upstream 1133) - #659
Conversation
…upstream #1133) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DH1b4gwq2kmMK94pdZRQZm
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Normalize prefixed XCTest kinds src/E2E.Mobile/SnapshotProjection.cs, tests/E2E.Mobile.Tests/Nodes/SnapshotProjectionTests.cs, COMPATIBILITY.md |
NormalizeKind strips the XCUIElementType prefix before existing normalization. Tests compare projected kinds and roles for prefixed and native type names, and verify the prefixed input retains a 390×844 viewport. Compatibility notes describe the normalization and tests. |
Use normalized kinds for keyboard detection src/E2E.Mobile/DeviceSession.Screen.cs, tests/E2E.Mobile.Tests/Engine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests.cs |
KeyboardShowing uses NormalizeKind to match keyboard types. A test verifies that dismissal swipes when the snapshot contains an XCUIElementTypeKeyboard node without an explicit keyboard fact. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- hardkoded/e2e-dotnet#596: It changes viewport and drag coordinates for keyboard dismissal after rotation. This PR changes keyboard detection that enables the dismissal swipe.
Suggested reviewers: cursoragent
Merge Risk: 
Minimal · up to 254e7
-
No actionable merge-blocking risk was identified in the reviewed changes.
Architecture risk: 
Low · up to 254e7
-
The change affects 3 systems.
Changed systems:
src,tests,COMPATIBILITY.mdArchitecture concerns
No architecture-level concerns identified.Review details
-
Systems and components
- observed — src (service) was modified; 2 changed files map to changed impact.
- observed — tests (service) was modified; 2 changed files map to changed impact.
- observed — COMPATIBILITY.md (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
- observed — Modified behavior in src/E2E.Mobile/DeviceSession.Screen.cs:
KeyboardShowingnow usesSnapshotProjection.NormalizeKindto normalize node types before matching keyboard types, instead of lowercasing the raw type. - observed — Modified behavior in src/E2E.Mobile/SnapshotProjection.cs:
NormalizeKindnow strips anXCUIElementTypeprefix before applying its existing word-boundary, separator, and lowercase normalization; prefixed XCTest element types therefore normalize consistently with unprefixed names. - observed — Modified behavior in src/E2E.Mobile/SnapshotProjection.cs: Added the generated regex used by
NormalizeKindto recognizeXCUIElementTypeonly when followed by an uppercase letter. - observed — Modified behavior in tests/E2E.Mobile.Tests/Engine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests.cs: Added a test that supplies an
XCUIElementTypeKeyboardnode without an explicit keyboard fact, invokes keyboard dismissal, and asserts that one swipe occurs.
-
Caution
Pre-merge checks failed
Please resolve all errors before merging. Addressing warnings is optional.
- Ignore

Passed checks: 4 passed
-
Full details: Linked Issues check
-
Explanation
Issue
#636requiresXCUIElementTypeprefix normalization, normalized keyboard detection, and ported tests.SnapshotProjection.NormalizeKindremoves the prefix, andDeviceSession.KeyboardShowinguses that normalization. The reported tests cover prefixed node types and roles, plusXCUIElementTypeKeyboarddetection.
-
Full details: Upstream Parity
-
Explanation
Fails point 4. The diff changes user-visible behavior in
SnapshotProjection.NormalizeKindandDeviceSession.KeyboardShowing, matching the upstream behavior identified in the PR description andCOMPATIBILITY.md. The PR adds the compatibility entry, but the changed-file inventory contains no update toskills/e2e-dotnet/SKILL.mdordocs/. The PR’s claim that those files have no upstream wording does not meet the check’s stated documentation requirement. Upstream source inspection was unavailable, so this assessment uses the PR text and compatibility entry as directed.Resolution
Update
skills/e2e-dotnet/SKILL.mdand applicabledocs/to document the XCUIElementType normalization and WebDriver keyboard detection using the C# names, and retain theCOMPATIBILITY.mdentry.
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Linked repositories: skipped tester-army/e2e. Repositories added from the pull request branch configuration require the pull request author (and the user who triggered the review, when different) to have read access to them.
Comment @coderabbitai help to get the list of available commands.
…m #1133) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DH1b4gwq2kmMK94pdZRQZm
|
Re "Upstream Parity" point 4 (SKILL.md, docs/ and COMPATIBILITY.md updates absent):
I added the COMPATIBILITY.md entry (in the mobile section, next to the known-viewport and keyboard-drag entries). I did not touch |
|
@coderabbitai review |
|
iOS sessions on agent-device's WebDriver runtime (hosted Appium clouds) report
XCUIElementTypeButtonwhere the native runner reportsButton, so roles resolved to nothing and a shown keyboard was not detected.SnapshotProjection.NormalizeKindnow drops^XCUIElementType(?=[A-Z])before mapping the type, andDeviceSession.KeyboardShowingroutes node types throughNormalizeKind. This is reachable through a customIPageSourceConverteronE2E.TestMu.Mobile.Ports tester-army/e2e#1133 (commit 3f9a7d8):
packages/mobile/src/nodes.ts(normalizeKind),packages/mobile/src/surface.ts(keyboardShowing), and the tests intests/unit/nodes.test.tsandtests/unit/engine.test.ts.Closes #636
Tests ported
Nodes/SnapshotProjectionTests:Reads_the_XCUIElementType_class_names_a_WebDriver_session_reports_as_the_native_XCTest_types(nodes.test.ts, full).Engine/DeviceFixtureDismissingAKeyboardThatHasNoDismissKeyTests:Reads_an_XCUIElementTypeKeyboard_from_a_WebDriver_session_as_a_shown_keyboard(engine.test.ts, full).Skipped / partial
.changeset/...); the port has no changesets.it: none.Port-only symbols
SnapshotProjection.XcuiElementTypePrefix(): a .NET[GeneratedRegex]for upstream's inline/^XCUIElementType(?=[A-Z])/(the port's regexes are all source-generated).NormalizeKindstaysinternal(upstream exports it).Minor decisions
🤖 Generated with Claude Code
https://claude.ai/code/session_01DH1b4gwq2kmMK94pdZRQZm
Summary by CodeRabbit
XCUIElementType-prefixed element names, allowing keyboards without a dismiss key to be dismissed with a swipe.