Skip to content

Commit

Permalink
Migrate Adding Patterns Test to Playwright (#50083)
Browse files Browse the repository at this point in the history
* Migrate Adding Patterns Test to Playwright

* Remove previous snapshot file

* Address feedbacks
  • Loading branch information
pooja-muchandikar authored Apr 26, 2023
1 parent e7ce202 commit c9874e4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.

This file was deleted.

22 changes: 0 additions & 22 deletions packages/e2e-tests/specs/editor/various/adding-patterns.test.js

This file was deleted.

30 changes: 30 additions & 0 deletions test/e2e/specs/editor/various/adding-patterns.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

test.describe( 'adding patterns', () => {
test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );

test( 'should insert a block pattern', async ( { page, editor } ) => {
await page.click(
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
);

await page.fill(
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
'Social links with a shared background color'
);

await page.click(
'role=option[name="Social links with a shared background color"i]'
);
await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'core/social-links',
},
] );
} );
} );

1 comment on commit c9874e4

@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 c9874e4.
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/4810324778
📝 Reported issues:

Please sign in to comment.