-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate 'container blocks' e2e tests to Playwright (#56141)
* Migrate 'Container block without paragraph support' tests * Migrate 'InnerBlocks Template Sync' tests * Remove old test files
- Loading branch information
Showing
4 changed files
with
228 additions
and
188 deletions.
There are no files selected for viewing
58 changes: 0 additions & 58 deletions
58
packages/e2e-tests/specs/editor/plugins/__snapshots__/container-blocks.test.js.snap
This file was deleted.
Oops, something went wrong.
130 changes: 0 additions & 130 deletions
130
packages/e2e-tests/specs/editor/plugins/container-blocks.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' } ], | ||
}, | ||
] ); | ||
} ); | ||
} ); |
Oops, something went wrong.