Skip to content

Commit

Permalink
Enhance template registration e2e tests to handle welcome dialog visi…
Browse files Browse the repository at this point in the history
…bility (WordPress#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 <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent 41062d2 commit b71da13
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/e2e/specs/site-editor/template-registration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.' },
Expand All @@ -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.' },
Expand Down

0 comments on commit b71da13

Please sign in to comment.