From a60de153f87632f1baf4cf48ec78717045c2365c Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Tue, 7 Apr 2026 12:25:58 +0200 Subject: [PATCH] page.waitForFunction: fix call arguments --- test/e2e/specs/editor/blocks/fit-text.spec.js | 2 ++ .../collaboration/collaboration-document-size-lock.spec.ts | 1 + .../editor/collaboration/collaboration-metabox-lock.spec.ts | 3 +++ .../editor/collaboration/collaboration-persistence.spec.ts | 1 + .../specs/editor/collaboration/collaboration-refresh.spec.ts | 3 +++ .../specs/editor/collaboration/fixtures/collaboration-utils.ts | 2 ++ test/e2e/specs/editor/various/big-image-size-threshold.spec.js | 2 ++ 7 files changed, 14 insertions(+) diff --git a/test/e2e/specs/editor/blocks/fit-text.spec.js b/test/e2e/specs/editor/blocks/fit-text.spec.js index c10e065155c4c7..28b550cb0f6e79 100644 --- a/test/e2e/specs/editor/blocks/fit-text.spec.js +++ b/test/e2e/specs/editor/blocks/fit-text.spec.js @@ -426,6 +426,7 @@ test.describe( 'Fit Text', () => { const el = document.querySelector( 'h2.has-fit-text' ); return el && el.style.fontSize && el.style.fontSize !== ''; }, + undefined, { timeout: 5000 } ); @@ -502,6 +503,7 @@ test.describe( 'Fit Text', () => { const el = document.querySelector( 'p.has-fit-text' ); return el && el.style.fontSize && el.style.fontSize !== ''; }, + undefined, { timeout: 5000 } ); diff --git a/test/e2e/specs/editor/collaboration/collaboration-document-size-lock.spec.ts b/test/e2e/specs/editor/collaboration/collaboration-document-size-lock.spec.ts index 935a8b8f00f957..2f3b90e9e023d7 100644 --- a/test/e2e/specs/editor/collaboration/collaboration-document-size-lock.spec.ts +++ b/test/e2e/specs/editor/collaboration/collaboration-document-size-lock.spec.ts @@ -62,6 +62,7 @@ test.describe( 'Collaboration with large documents', () => { window?.wp?.data ?.select( 'core/editor' ) ?.isCollaborationEnabledForCurrentPost?.() === false, + undefined, { timeout: 15000 } ); diff --git a/test/e2e/specs/editor/collaboration/collaboration-metabox-lock.spec.ts b/test/e2e/specs/editor/collaboration/collaboration-metabox-lock.spec.ts index b0f447e136a5e2..8f213ab1431916 100644 --- a/test/e2e/specs/editor/collaboration/collaboration-metabox-lock.spec.ts +++ b/test/e2e/specs/editor/collaboration/collaboration-metabox-lock.spec.ts @@ -55,6 +55,7 @@ test.describe( 'Collaboration with meta boxes', () => { window?.wp?.data ?.select( 'core/editor' ) ?.isCollaborationEnabledForCurrentPost?.() === false, + undefined, { timeout: 15000 } ); @@ -84,6 +85,7 @@ test.describe( 'Collaboration with meta boxes', () => { // Wait for wp.data to be available on User 2's page. await page2.waitForFunction( () => window?.wp?.data && window?.wp?.blocks, + undefined, { timeout: 15000 } ); @@ -160,6 +162,7 @@ test.describe( 'Collaboration with meta boxes', () => { window?.wp?.data ?.select( 'core/editor' ) ?.isCollaborationEnabledForCurrentPost?.() === true, + undefined, { timeout: 15000 } ); diff --git a/test/e2e/specs/editor/collaboration/collaboration-persistence.spec.ts b/test/e2e/specs/editor/collaboration/collaboration-persistence.spec.ts index b902eebc553054..d40dc81c9a9281 100644 --- a/test/e2e/specs/editor/collaboration/collaboration-persistence.spec.ts +++ b/test/e2e/specs/editor/collaboration/collaboration-persistence.spec.ts @@ -65,6 +65,7 @@ test.describe( 'Collaboration - CRDT persistence', () => { // wait for the entity record resolver to finish. await page.waitForFunction( () => ( window as any )._wpCollaborationEnabled === true, + undefined, { timeout: 5000 } ); await collaborationUtils.waitForEntityReady( page, { diff --git a/test/e2e/specs/editor/collaboration/collaboration-refresh.spec.ts b/test/e2e/specs/editor/collaboration/collaboration-refresh.spec.ts index cc6816fbe1c3c7..6d7799e651d1c2 100644 --- a/test/e2e/specs/editor/collaboration/collaboration-refresh.spec.ts +++ b/test/e2e/specs/editor/collaboration/collaboration-refresh.spec.ts @@ -56,6 +56,7 @@ test.describe( 'Collaboration - Refresh', () => { ( window as any )._wpCollaborationEnabled === true && window?.wp?.data && window?.wp?.blocks, + undefined, { timeout: 15000 } ); @@ -96,6 +97,7 @@ test.describe( 'Collaboration - Refresh', () => { ( window as any )._wpCollaborationEnabled === true && window?.wp?.data && window?.wp?.blocks, + undefined, { timeout: 15000 } ); editor2 = new Editor( { page: page2 } ); @@ -142,6 +144,7 @@ test.describe( 'Collaboration - Refresh', () => { ( window as any )._wpCollaborationEnabled === true && window?.wp?.data && window?.wp?.blocks, + undefined, { timeout: 15000 } ); diff --git a/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts b/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts index d809fcc29a7a82..c85db8bd786211 100644 --- a/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts +++ b/test/e2e/specs/editor/collaboration/fixtures/collaboration-utils.ts @@ -260,6 +260,7 @@ export default class CollaborationUtils { .select( 'core/editor' ) .isSavingPost(); }, + undefined, { timeout } ); } @@ -300,6 +301,7 @@ export default class CollaborationUtils { ( window as any )._wpCollaborationEnabled === true && window?.wp?.data && window?.wp?.blocks, + undefined, { timeout } ); } diff --git a/test/e2e/specs/editor/various/big-image-size-threshold.spec.js b/test/e2e/specs/editor/various/big-image-size-threshold.spec.js index d866d0789e0edf..fa079ab3557f3f 100644 --- a/test/e2e/specs/editor/various/big-image-size-threshold.spec.js +++ b/test/e2e/specs/editor/various/big-image-size-threshold.spec.js @@ -89,6 +89,7 @@ test.describe( 'Big image size threshold', () => { const items = uploadStore.getItems(); return items.length === 0; }, + undefined, { timeout: 120000 } ); @@ -191,6 +192,7 @@ test.describe( 'Big image size threshold', () => { const items = uploadStore.getItems(); return items.length === 0; }, + undefined, { timeout: 120000 } );