From a2ab81bb1b6680c63fb34d31bf50c88621bdd54f Mon Sep 17 00:00:00 2001 From: harryisfish Date: Tue, 10 Nov 2026 20:42:05 +0800 Subject: [PATCH 1/2] test(e2e): find the deferred input pane before its cancel button is visible The iOS provider run failed every time before cancelling the deferred input: the scroll pane was looked up by the cancel button with visible: true, which matches nothing while the button is still below the fold. Match the pane by the button regardless of visibility and wait for its bounds to settle inside the pane before clicking, as the workspace native test already does. --- tests/e2e/native-transfers.e2e.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/e2e/native-transfers.e2e.ts b/tests/e2e/native-transfers.e2e.ts index d83407db..8a6a01ee 100644 --- a/tests/e2e/native-transfers.e2e.ts +++ b/tests/e2e/native-transfers.e2e.ts @@ -536,10 +536,21 @@ test('provider settings and queued cancellation work in the installed native app expect((await inspect()).jobs).toEqual([{ trigger: runningTrigger, state: 'running' }]); expect((await inspect()).total_invocations).toBe(1); const cancel = optionsSheet.getByRole('button', '取消稍后输入', { exact: true, visible: true }); - const deferredScroll = device.locator('role=scroll-area').filter({ has: cancel }); + // The pane is found by a button that may still be below the fold; only the click needs it visible. + const deferredScroll = device.locator('role=scroll-area').filter({ + has: optionsSheet.getByRole('button', '取消稍后输入', { exact: true }), + }); await expect(deferredScroll).toHaveCount(1); await deferredScroll.scrollUntilVisible(cancel, { direction: 'down' }); await expect(cancel).toBeEnabled(); + let previousCancelBounds = ''; + await expect.poll(async () => { + const bounds = await cancel.boundingBox(), pane = await deferredScroll.boundingBox(); + assert(bounds && pane, 'Deferred Cancel and its scroll pane expose bounds'); + const observed = JSON.stringify([bounds, pane]), stable = observed === previousCancelBounds; + previousCancelBounds = observed; + return stable && bounds.x >= pane.x && bounds.y >= pane.y && bounds.x + bounds.width <= pane.x + pane.width && bounds.y + bounds.height <= pane.y + pane.height; + }).toBe(true); await cancel.click(); await expect.poll(async () => (await inspect()).deferred_input).toEqual({ message_id: deferredMessageId, target: { kind: 'bot_main', bot_id: botId }, deferred: true, cancelled: true, From 174fb21fd1be6b578f63b18a0fbcdb98d921843a Mon Sep 17 00:00:00 2001 From: harryisfish Date: Tue, 10 Nov 2026 22:05:18 +0800 Subject: [PATCH 2/2] test(e2e): match the deferred input pane by a root locator --- tests/e2e/native-transfers.e2e.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/native-transfers.e2e.ts b/tests/e2e/native-transfers.e2e.ts index 8a6a01ee..59af0855 100644 --- a/tests/e2e/native-transfers.e2e.ts +++ b/tests/e2e/native-transfers.e2e.ts @@ -536,9 +536,10 @@ test('provider settings and queued cancellation work in the installed native app expect((await inspect()).jobs).toEqual([{ trigger: runningTrigger, state: 'running' }]); expect((await inspect()).total_invocations).toBe(1); const cancel = optionsSheet.getByRole('button', '取消稍后输入', { exact: true, visible: true }); - // The pane is found by a button that may still be below the fold; only the click needs it visible. + // `has` searches inside each pane, so it takes a root locator that is not limited to visible elements; + // the button can still be below the fold. const deferredScroll = device.locator('role=scroll-area').filter({ - has: optionsSheet.getByRole('button', '取消稍后输入', { exact: true }), + has: screen.getByRole('button', '取消稍后输入', { exact: true }), }); await expect(deferredScroll).toHaveCount(1); await deferredScroll.scrollUntilVisible(cancel, { direction: 'down' });