Skip to content

test(ios): repro test for setting caret on adjacent thought (#4173)#4

Closed
ethan-james wants to merge 1 commit into
mainfrom
ethan-james-test-4173-ios-repro
Closed

test(ios): repro test for setting caret on adjacent thought (#4173)#4
ethan-james wants to merge 1 commit into
mainfrom
ethan-james-test-4173-ios-repro

Conversation

@ethan-james

Copy link
Copy Markdown
Owner

cybersemics#4173

Summary

Adds an iOS/wdio regression test that attempts to reproduce #4173: tapping an adjacent thought within ~1 second of a previous tap fails to move the cursor (the second tap's setCursor is never dispatched). Tapping a non-adjacent thought works.

The suspicion was that the bug couldn't be reproduced manually because a human can't tap two adjacent thoughts fast enough. This PR tests that hypothesis with programmatically controlled sub-second timing.

What's here

  • src/e2e/iOS/helpers/doubleTap.ts — a new touch helper that resolves both target coordinates up front and fires two real touch taps (pointerType: 'touch') in a single performActions sequence with a deterministic intervalMs gap between them. Resolving coordinates first means the inter-tap interval is exactly intervalMs (default 300ms) rather than incidental Appium round-trip latency, which can exceed a second. Interval is overridable via TAP_INTERVAL_MS.
  • src/e2e/iOS/__tests__/caret.ts — a new test in the Caret suite that seeds a / b / c, double-taps a then the adjacent b, and asserts the cursor lands on b via getEditingText() (which reflects state.cursor independent of keyboard/edit-mode state).

Why a real device

The bug does not reproduce in the local iOS Simulator via WebDriver touch injection — synthetic touch appears to bypass the native WebKit rapid-tap gesture recognition that causes the failure on real hardware. This PR exists to run the same repro attempt on a real BrowserStack device in CI (the diagnostic goal).

  • If the test fails on BrowserStack → the bug reproduces on real hardware and we have a regression test.
  • If it passes → the bug is not reproducible via automated touch injection anywhere, and a real fix will need a different repro strategy.

No production code is changed.


Draft until the BrowserStack CI result is known.

…rsemics#4173)

Adds an iOS/wdio regression test that attempts to reproduce cybersemics#4173, where
tapping an adjacent thought within ~1s of a previous tap fails to move the
cursor. Introduces a `doubleTap` touch helper that fires two real touch taps
with a deterministic sub-second interval, since a hand-driven repro cannot
reliably tap fast enough.

The bug does not reproduce in the local iOS Simulator via WebDriver touch
injection; this test is intended to run on a real BrowserStack device in CI to
determine whether the failure reproduces on real hardware.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ethan-james

Copy link
Copy Markdown
Owner Author

Superseded by cybersemics#4538, which runs against the repo that holds the BrowserStack secrets.

@ethan-james ethan-james closed this Jul 7, 2026
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