From b691c1bc786d46e50241a34e322a1866d782e20b Mon Sep 17 00:00:00 2001 From: Aki Hamano Date: Thu, 10 Oct 2024 21:28:41 +0900 Subject: [PATCH] Try to fix perf test --- test/performance/specs/post-editor.spec.js | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/test/performance/specs/post-editor.spec.js b/test/performance/specs/post-editor.spec.js index 7e2071d217726..becbf375eff2a 100644 --- a/test/performance/specs/post-editor.spec.js +++ b/test/performance/specs/post-editor.spec.js @@ -368,9 +368,11 @@ test.describe( 'Post Editor Performance', () => { // Go to the test page. await admin.editPost( draftId ); await perfUtils.disableAutosave(); - const globalInserterToggle = page.getByRole( 'button', { - name: 'Block Inserter', - } ); + const globalInserterToggle = page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { + name: 'Block Inserter', + } ); const samples = 10; const throwaway = 1; @@ -424,9 +426,11 @@ test.describe( 'Post Editor Performance', () => { // Go to the test page. await admin.editPost( draftId ); await perfUtils.disableAutosave(); - const globalInserterToggle = page.getByRole( 'button', { - name: 'Block Inserter', - } ); + const globalInserterToggle = page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { + name: 'Block Inserter', + } ); // Open Inserter. await globalInserterToggle.click(); @@ -483,9 +487,11 @@ test.describe( 'Post Editor Performance', () => { await admin.editPost( draftId ); await perfUtils.disableAutosave(); - const globalInserterToggle = page.getByRole( 'button', { - name: 'Block Inserter', - } ); + const globalInserterToggle = page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { + name: 'Block Inserter', + } ); const paragraphBlockItem = page.locator( '.block-editor-inserter__menu .editor-block-list-item-paragraph' ); @@ -535,9 +541,11 @@ test.describe( 'Post Editor Performance', () => { test( 'Run the test', async ( { page, admin, perfUtils } ) => { await admin.createNewPost(); await perfUtils.disableAutosave(); - const globalInserterToggle = page.getByRole( 'button', { - name: 'Block Inserter', - } ); + const globalInserterToggle = page + .getByRole( 'region', { name: 'Editor top bar' } ) + .getByRole( 'button', { + name: 'Block Inserter', + } ); const testPatterns = [ {