Skip to content

Commit

Permalink
Migrate 'container blocks' e2e tests to Playwright (#56141)
Browse files Browse the repository at this point in the history
* Migrate 'Container block without paragraph support' tests
* Migrate 'InnerBlocks Template Sync' tests
* Remove old test files
  • Loading branch information
Mamaduka authored Nov 15, 2023
1 parent 0917f86 commit e131e6e
Show file tree
Hide file tree
Showing 4 changed files with 228 additions and 188 deletions.

This file was deleted.

130 changes: 0 additions & 130 deletions packages/e2e-tests/specs/editor/plugins/container-blocks.test.js

This file was deleted.

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

test.describe( 'Container block without paragraph support', () => {
test.beforeAll( async ( { requestUtils } ) => {
await requestUtils.activatePlugin(
'gutenberg-test-container-block-without-paragraph'
);
} );

test.beforeEach( async ( { admin } ) => {
await admin.createNewPost();
} );

test.afterAll( async ( { requestUtils } ) => {
await requestUtils.deactivatePlugin(
'gutenberg-test-container-block-without-paragraph'
);
} );

test( 'ensures we can use the alternative block appender properly', async ( {
editor,
page,
} ) => {
await editor.insertBlock( {
name: 'test/container-without-paragraph',
} );

await page
.getByRole( 'document', {
name: 'Block: Container without paragraph',
} )
.getByRole( 'button', { name: 'Add block' } )
.click();

await page
.getByRole( 'listbox', { name: 'Blocks' } )
.getByRole( 'option', { name: 'Image' } )
.click();

await expect.poll( editor.getBlocks ).toMatchObject( [
{
name: 'test/container-without-paragraph',
innerBlocks: [ { name: 'core/image' } ],
},
] );
} );
} );
Loading

0 comments on commit e131e6e

Please sign in to comment.