Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions test/performance/specs/post-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
} )(),
] );
Expand Down
11 changes: 2 additions & 9 deletions test/performance/specs/site-editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( {
Expand All @@ -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 ) {
Expand Down