Skip to content

Commit

Permalink
Migrate separator block tests to Playwright (#41130)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
JustinyAhin and kevin940726 authored May 26, 2022
1 parent b1bbfc5 commit c3baafc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 29 deletions.

This file was deleted.

22 changes: 0 additions & 22 deletions packages/e2e-tests/specs/editor/blocks/separator.test.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- wp:separator -->
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<!-- /wp:separator -->
21 changes: 21 additions & 0 deletions test/e2e/specs/editor/blocks/separator.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* WordPress dependencies
*/
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' );

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

test( 'can be created by three dashes and enter', async ( {
editor,
page,
} ) => {
await page.click( 'role=button[name="Add default block"i]' );
await page.keyboard.type( '---' );
await page.keyboard.press( 'Enter' );

expect( await editor.getEditedPostContent() ).toMatchSnapshot();
} );
} );

0 comments on commit c3baafc

Please sign in to comment.