From b71da13e16b2177fcf272966846304cdd8a665dc Mon Sep 17 00:00:00 2001 From: Michal Date: Wed, 18 Dec 2024 15:47:27 +0000 Subject: [PATCH] Enhance template registration e2e tests to handle welcome dialog visibility (#68059) * Enhance template registration e2e tests to handle welcome dialog visibility Added logic to check for the visibility of the "Welcome to the editor" dialog within 2 seconds before attempting to close it. * Replace `visitAdminPage( '/post-new.php' )` with `createNewPost()` and remove the updates to the second test * Remove extra whitespace * Replace `visitAdminPage` with `createNewPost()` in `themes can override registered templates` e2e test Co-authored-by: michalczaplinski Co-authored-by: Mamaduka --- test/e2e/specs/site-editor/template-registration.spec.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/e2e/specs/site-editor/template-registration.spec.js b/test/e2e/specs/site-editor/template-registration.spec.js index ed89c7d18bf3fb..2960367fc32ef1 100644 --- a/test/e2e/specs/site-editor/template-registration.spec.js +++ b/test/e2e/specs/site-editor/template-registration.spec.js @@ -100,8 +100,7 @@ test.describe( 'Block template registration', () => { page, } ) => { // Create a post. - await admin.visitAdminPage( '/post-new.php' ); - await page.getByLabel( 'Close', { exact: true } ).click(); + await admin.createNewPost(); await editor.insertBlock( { name: 'core/paragraph', attributes: { content: 'User-created post.' }, @@ -128,7 +127,7 @@ test.describe( 'Block template registration', () => { blockTemplateRegistrationUtils, } ) => { // Create a post. - await admin.visitAdminPage( '/post-new.php' ); + await admin.createNewPost(); await editor.insertBlock( { name: 'core/paragraph', attributes: { content: 'User-created post.' },