Skip to content

Commit

Permalink
Migrate register block test case to playwright (#43170)
Browse files Browse the repository at this point in the history
* Migrate register block test case to playwright

* Addressed feedback

Co-authored-by: pavanpatil1 <=>
  • Loading branch information
pavanpatil1 authored Aug 25, 2022
1 parent dcfff3a commit 9bde7eb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 32 deletions.

This file was deleted.

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

test.describe( 'Register block type hooks', () => {
test.beforeEach( async ( { requestUtils, admin } ) => {
await requestUtils.activatePlugin(
'gutenberg-test-register-block-type-hooks'
);
await admin.createNewPost();
} );

test.afterEach( async ( { requestUtils } ) => {
await requestUtils.deactivatePlugin(
'gutenberg-test-register-block-type-hooks'
);
} );

test( 'has a custom category for Paragraph block', async ( { page } ) => {
await page.click( 'role=button[name="Toggle block inserter"i]' );

expect(
page.locator(
'role=listbox[name="Widgets"i] >> role=option[name="Paragraph"i]'
)
).toBeDefined();
} );
} );

0 comments on commit 9bde7eb

Please sign in to comment.