Skip to content

Commit ee2333e

Browse files
CodeGhost21claude
andcommitted
fix(e2e): scroll element into view before clicking on tauri-driver
webkit2gtk doesn't auto-scroll elements into the viewport. Add scrollIntoView before click to fix 'element not interactable' errors on Linux CI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c420587 commit ee2333e

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎app/test/e2e/helpers/element-helpers.ts‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,20 @@ function xpathContainsText(text: string): string {
6767
*/
6868
async function clickAtElement(el: ChainablePromiseElement): Promise<void> {
6969
if (isTauriDriver()) {
70+
// Scroll element into view first — webkit2gtk may not auto-scroll
71+
try {
72+
await browser.execute(
73+
(e: HTMLElement) => e.scrollIntoView({ block: 'center', behavior: 'instant' }),
74+
el as unknown as HTMLElement
75+
);
76+
await browser.pause(200);
77+
} catch {
78+
// scrollIntoView may fail if element is detached
79+
}
7080
try {
7181
await el.click();
7282
} catch {
73-
// Fallback: element may not be interactable (off-screen, covered).
74-
// Use JS click which bypasses visibility checks.
83+
// Fallback: use JS click which bypasses visibility checks
7584
await browser.execute((e: HTMLElement) => e.click(), el as unknown as HTMLElement);
7685
}
7786
return;

0 commit comments

Comments
 (0)