Skip to content

Commit 4d1fff1

Browse files
JustinyAhinkevin940726
authored andcommitted
Migrate separator block tests to Playwright (#41130)
* Migrate separator block tests to Playwright * Remove use of clickBlockAppender() utils * Use locators where possible * Use page.click() Co-authored-by: Kai Hao <kevin830726@gmail.com>
1 parent 4f3f66d commit 4d1fff1

File tree

4 files changed

+24
-29
lines changed

4 files changed

+24
-29
lines changed

packages/e2e-tests/specs/editor/blocks/__snapshots__/separator.test.js.snap

-7
This file was deleted.

packages/e2e-tests/specs/editor/blocks/separator.test.js

-22
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- wp:separator -->
2+
<hr class="wp-block-separator has-alpha-channel-opacity"/>
3+
<!-- /wp:separator -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* WordPress dependencies
3+
*/
4+
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );
5+
6+
test.describe( 'Separator', () => {
7+
test.beforeEach( async ( { admin } ) => {
8+
await admin.createNewPost();
9+
} );
10+
11+
test( 'can be created by three dashes and enter', async ( {
12+
editor,
13+
page,
14+
} ) => {
15+
await page.click( 'role=button[name="Add default block"i]' );
16+
await page.keyboard.type( '---' );
17+
await page.keyboard.press( 'Enter' );
18+
19+
expect( await editor.getEditedPostContent() ).toMatchSnapshot();
20+
} );
21+
} );

0 commit comments

Comments
 (0)