Skip to content

Commit c9874e4

Browse files
Migrate Adding Patterns Test to Playwright (#50083)
* Migrate Adding Patterns Test to Playwright * Remove previous snapshot file * Address feedbacks
1 parent e7ce202 commit c9874e4

File tree

3 files changed

+30
-33
lines changed

3 files changed

+30
-33
lines changed

packages/e2e-tests/specs/editor/various/__snapshots__/adding-patterns.test.js.snap

-11
This file was deleted.

packages/e2e-tests/specs/editor/various/adding-patterns.test.js

-22
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
5+
6+
test.describe( 'adding patterns', () => {
7+
test.beforeEach( async ( { admin } ) => {
8+
await admin.createNewPost();
9+
} );
10+
11+
test( 'should insert a block pattern', async ( { page, editor } ) => {
12+
await page.click(
13+
'role=region[name="Editor top bar"i] >> role=button[name="Toggle block inserter"i]'
14+
);
15+
16+
await page.fill(
17+
'role=region[name="Block Library"i] >> role=searchbox[name="Search for blocks and patterns"i]',
18+
'Social links with a shared background color'
19+
);
20+
21+
await page.click(
22+
'role=option[name="Social links with a shared background color"i]'
23+
);
24+
await expect.poll( editor.getBlocks ).toMatchObject( [
25+
{
26+
name: 'core/social-links',
27+
},
28+
] );
29+
} );
30+
} );

0 commit comments

Comments
 (0)