Skip to content
Closed
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e87dc6b
Create iOS browserstack test
ethan-james Jun 17, 2026
eccf583
Check activeElemnt in browser.execute
ethan-james Jun 19, 2026
83c35d5
Fix TransitionStyle error caused by radix-ui version bump
ethan-james Jun 18, 2026
eeb8621
Merge branch 'main' into 4394-bug-prevent-focus-on-non-cursor-thoughts
ethan-james Jun 19, 2026
6225800
Move tap position right
ethan-james Jun 19, 2026
560a62d
Increase lint:src old space size
ethan-james Jun 19, 2026
ddc823a
Nudge tap position right
ethan-james Jun 19, 2026
74d3dd0
Merge branch 'main' into 4394-bug-prevent-focus-on-non-cursor-thoughts
ethan-james Jun 19, 2026
465a826
Merge branch 'main' into 4394-bug-prevent-focus-on-non-cursor-thoughts
ethan-james Jun 22, 2026
d2a202c
Profile events in test
ethan-james Jun 23, 2026
363ac00
Add more logging to browserstack test
ethan-james Jun 23, 2026
866f831
Nudge tap position down
ethan-james Jun 23, 2026
721993f
Remove redundant event profiling
ethan-james Jun 23, 2026
25c17d8
Try to match touch event position in browserstack test
ethan-james Jun 23, 2026
dee9340
Tweak touch event position
ethan-james Jun 23, 2026
48794ae
Use gesture in test to trigger compatability events
ethan-james Jun 24, 2026
8050965
Nudge y position of gesture
ethan-james Jun 24, 2026
b24f377
Fix y position of gesture
ethan-james Jun 29, 2026
a2f9c78
Add pointerType option to tap helper
ethan-james Jun 29, 2026
0573ddc
Nudge x position of tap
ethan-james Jun 29, 2026
a982645
Add y:60 to tap call in new test
ethan-james Jun 29, 2026
786dc62
Failing browserstack test before main merge
ethan-james Jun 30, 2026
cbda577
Update test with click handler
ethan-james Jul 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"deploy:staging2": "yarn lint && yarn build && firebase hosting:channel:deploy staging2 --expires 30d",
"lint:lockfile": "npx lockfile-lint",
"lint:no-npm": "node ./scripts/no-files.js package-lock.json",
"lint:src": "FORCE_COLOR=1 eslint . --cache --rule 'no-console: [2, { allow: [error, info, warn] }]'",
"lint:src": "FORCE_COLOR=1 NODE_OPTIONS=--max-old-space-size=4096 eslint . --cache --rule 'no-console: [2, { allow: [error, info, warn] }]'",
"lint:tsc": "tsc",
"lint": "FORCE_COLOR=1 npm-run-all --serial \"lint:*\"",
"postinstall": "yarn build:packages && git config core.hooksPath .hooks && yarn build:styles",
Expand Down
23 changes: 23 additions & 0 deletions src/e2e/iOS/__tests__/caret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import newThought from '../helpers/newThought'
import paste from '../helpers/paste'
import tap from '../helpers/tap'
import waitForEditable from '../helpers/waitForEditable'
import waitForElement from '../helpers/waitForElement'
import waitUntil from '../helpers/waitUntil'

// tests succeeds individually, but fails when there are too many tests running in parallel
Expand Down Expand Up @@ -251,4 +252,26 @@ describe('Caret', () => {
expect(selectionTextContent).toBe('new')
expect(childrenTexts).toEqual(['foo', 'bar'])
})

it('Focus is prevented after clearing the cursor', async () => {
await newThought('Hello')
await hideKeyboardByTappingDone()

const homeNodeHandle = await waitForElement('[data-testid="home"]')
await tap(homeNodeHandle)

await tap(await waitForEditable('Hello'), { horizontalTapLine: 'right', x: 20 + 6, y: 60, pointerType: 'touch' })

// Wait for focus to be cleared and activeElement to be body
await waitUntil(async () => {
const isBody = await browser.execute(() => document.activeElement === document.body)
const nodeType = await browser.execute(() => document.activeElement?.nodeType)
console.info('activeElement check - isBody:', isBody, 'nodeType:', nodeType)
return isBody
})

const activeElementIsBody = await browser.execute(() => document.activeElement === document.body)
console.info('Final check - activeElementIsBody:', activeElementIsBody)
expect(activeElementIsBody).toBe(true)
})
})
6 changes: 4 additions & 2 deletions src/e2e/iOS/helpers/tap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import type { Element } from 'webdriverio'
interface Options {
// Where in the horizontal line (inside) of the target node should be tapped
horizontalTapLine?: 'left' | 'right'
// Pointer type to use for the tap action. Defaults to 'mouse'.
pointerType?: 'mouse' | 'touch'

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.

I understand that pointerType: 'mouse' solves a problem, but I'm concerned about the consequences of doing this in a mobile test. We want the iOS Appium tests to behave exactly like a touch device. It seems like setting pointerType: 'mouse' on a simulated touch device would create an artificial environment that doesn't reflect a real situation that could be encountered. This would put into question any test that uses this tap helper, because it's not guaranteed that an actual touch device would behave the same way.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, pointerType: 'mouse' was hard-coded into the helper prior to this. It would probably be worthwhile to revisit the other tests that use the helper and see if they work with pointerType: 'touch' instead.

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.

Ah, I didn't realize we were already doing that in main. Okay, something to keep in mind. Seems like a 🚩 at least.

// Specify specific node on editable to tap. Overrides horizontalClickLine
offset?: number
// Number of pixels of x offset to add to the tap coordinates
Expand All @@ -21,7 +23,7 @@ interface Options {
*/
const tap = async (
nodeHandle: Element,
{ horizontalTapLine = 'left', offset, x = 0, y = 0, releaseDelayMs = 100 }: Options = {},
{ horizontalTapLine = 'left', offset, x = 0, y = 0, pointerType = 'mouse', releaseDelayMs = 100 }: Options = {},
) => {
// Ensure element exists and has an elementId
const exists = await nodeHandle.isExisting()
Expand Down Expand Up @@ -98,7 +100,7 @@ const tap = async (
{
type: 'pointer',
id: 'pointer1',
parameters: { pointerType: 'mouse' },
parameters: { pointerType },
actions: [
{
type: 'pointerMove',
Expand Down
Loading