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 (#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 <czapla@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
  • 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

1 comment on commit b71da13

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in b71da13.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12396475353
📝 Reported issues:

Please sign in to comment.