diff --git a/test/performance/specs/post-editor.spec.js b/test/performance/specs/post-editor.spec.js index f808a4076d39fc..7b02ddd7f846b9 100644 --- a/test/performance/specs/post-editor.spec.js +++ b/test/performance/specs/post-editor.spec.js @@ -92,17 +92,19 @@ test.describe( 'Post Editor Performance', () => { // Get canvas (handles both legacy and iframed canvas). const canvas = await Promise.any( [ ( async () => { - const legacyCanvasLocator = page.locator( + const legacyCanvasLocator = testPage.locator( '.wp-block-post-content' ); - await legacyCanvasLocator.waitFor(); + await legacyCanvasLocator.waitFor( { timeout: 120_000 } ); return legacyCanvasLocator; } )(), ( async () => { - const iframedCanvasLocator = page.frameLocator( + const iframedCanvasLocator = testPage.frameLocator( '[name=editor-canvas]' ); - await iframedCanvasLocator.locator( 'body' ).waitFor(); + await iframedCanvasLocator + .locator( 'body' ) + .waitFor( { timeout: 120_000 } ); return iframedCanvasLocator; } )(), ] ); diff --git a/test/performance/specs/site-editor.spec.js b/test/performance/specs/site-editor.spec.js index 2a96cf30892235..1a5c0a96b6846f 100644 --- a/test/performance/specs/site-editor.spec.js +++ b/test/performance/specs/site-editor.spec.js @@ -85,9 +85,7 @@ test.describe( 'Site Editor Performance', () => { ).toBeDisabled(); // Get the ID of the saved page. - testPageId = await page.evaluate( () => - new URL( document.location ).searchParams.get( 'post' ) - ); + testPageId = new URL( page.url() ).searchParams.get( 'post' ); // Open the test page in Site Editor. await admin.visitSiteEditor( { @@ -109,17 +107,12 @@ test.describe( 'Site Editor Performance', () => { // Go to the test page URL. await testPage.goto( draftURL ); - // Wait for the canvas to appear. - await testPage - .locator( '.edit-site-canvas-loader' ) - .waitFor( { state: 'hidden', timeout: 60_000 } ); - // Wait for the first block. await testPage .frameLocator( 'iframe[name="editor-canvas"]' ) .locator( '.wp-block' ) .first() - .waitFor( { timeout: 60_000 } ); + .waitFor( { timeout: 120_000 } ); // Save the results. if ( i >= throwaway ) {