From 3527d059bd3e2ecb45df5eaf4f0f6f699ece99e8 Mon Sep 17 00:00:00 2001 From: James Martin <393605+ymhr@users.noreply.github.com> Date: Thu, 10 Sep 2026 08:28:12 +0000 Subject: [PATCH] fix(core): Fix flakey e2e test by awaiting debounce (no-changelog) (#38082) --- .../playwright/composables/WorkflowComposer.ts | 1 + .../playwright/pages/components/ResourceMoveModal.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/packages/testing/playwright/composables/WorkflowComposer.ts b/packages/testing/playwright/composables/WorkflowComposer.ts index 97ef81393cc..6f710f70ee7 100644 --- a/packages/testing/playwright/composables/WorkflowComposer.ts +++ b/packages/testing/playwright/composables/WorkflowComposer.ts @@ -119,6 +119,7 @@ export class WorkflowComposer { await this.n8n.page.keyboard.press('ControlOrMeta+a'); await this.n8n.page.keyboard.press('Backspace'); await this.n8n.page.keyboard.type(projectNameOrEmail, { delay: 50 }); + await this.n8n.resourceMoveModal.waitForDebounce(); const projectOption = this.n8n.page .getByTestId('project-sharing-info') diff --git a/packages/testing/playwright/pages/components/ResourceMoveModal.ts b/packages/testing/playwright/pages/components/ResourceMoveModal.ts index 58ad818430c..4b54e7be595 100644 --- a/packages/testing/playwright/pages/components/ResourceMoveModal.ts +++ b/packages/testing/playwright/pages/components/ResourceMoveModal.ts @@ -62,4 +62,16 @@ export class ResourceMoveModal extends FloatingUiHelper { async clickConfirmMoveButton(): Promise { await this.getMoveConfirmButton().click(); } + + /** + * Waits for the project select's remote search to settle after typing. + * The search is debounced twice — element-plus's own remote-method + * debounce and this component's own search debounce, 300ms each — so up + * to ~600ms can pass between the last keystroke and the option list + * actually reflecting it. + */ + async waitForDebounce(): Promise { + // eslint-disable-next-line playwright/no-wait-for-timeout + await this.page.waitForTimeout(800); + } }