From 9454f24a9296f118fe60b1e92f7e2f66e8ff8b34 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Tue, 3 Dec 2024 10:24:09 +0200 Subject: [PATCH] fix tests --- test/e2e/specs/site-editor/template-registration.spec.js | 4 +++- test/performance/specs/site-editor.spec.js | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/e2e/specs/site-editor/template-registration.spec.js b/test/e2e/specs/site-editor/template-registration.spec.js index 86f71bcfebb1c7..91eabb72801bb4 100644 --- a/test/e2e/specs/site-editor/template-registration.spec.js +++ b/test/e2e/specs/site-editor/template-registration.spec.js @@ -319,7 +319,9 @@ test.describe( 'Block template registration', () => { .getByLabel( 'Dismiss this notice' ) .getByText( `"Author: Admin" reset.` ); await page.getByPlaceholder( 'Search' ).fill( 'Author: admin' ); - await page.getByRole( 'button', { name: 'Author: Admin' } ).click(); + await page + .locator( '.fields-title-field', { hasText: 'Author: Admin' } ) + .click(); const actions = page.getByLabel( 'Actions' ); await actions.first().click(); await page.getByRole( 'menuitem', { name: 'Reset' } ).click(); diff --git a/test/performance/specs/site-editor.spec.js b/test/performance/specs/site-editor.spec.js index e72d83fa8b3aa4..7e8393e8c4b3be 100644 --- a/test/performance/specs/site-editor.spec.js +++ b/test/performance/specs/site-editor.spec.js @@ -237,7 +237,11 @@ test.describe( 'Site Editor Performance', () => { } await metrics.startTracing(); - await page.getByText( 'Single Posts', { exact: true } ).click(); + await page + .locator( '.fields-title-field', { + hasText: 'Single Posts', + } ) + .click(); await metrics.stopTracing(); // Get the durations.