-
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 deprecated node matcher tests to playwright (#42759)
Co-authored-by: pavanpatil1 <=>
- Loading branch information
1 parent
69c294d
commit d908473
Showing
5 changed files
with
61 additions
and
57 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
packages/e2e-tests/specs/editor/plugins/__snapshots__/deprecated-node-matcher.test.js.snap
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
packages/e2e-tests/specs/editor/plugins/deprecated-node-matcher.test.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
...apshots__/Deprecated-Node-Matcher-should-insert-block-with-children-source-1-chromium.txt
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,3 @@ | ||
<!-- wp:deprecated-children-matcher --> | ||
<p class="wp-block-deprecated-children-matcher">test<br/><strong>a</strong></p> | ||
<!-- /wp:deprecated-children-matcher --> |
3 changes: 3 additions & 0 deletions
3
...__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-node-source-1-chromium.txt
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,3 @@ | ||
<!-- wp:deprecated-node-matcher --> | ||
<blockquote class="wp-block-deprecated-node-matcher"><p>test</p><p></p></blockquote> | ||
<!-- /wp:deprecated-node-matcher --> |
55 changes: 55 additions & 0 deletions
55
test/e2e/specs/editor/plugins/deprecated-node-matcher.spec.js
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,55 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'Deprecated Node Matcher', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activatePlugin( | ||
'gutenberg-test-deprecated-node-matcher' | ||
); | ||
} ); | ||
|
||
test.beforeEach( async ( { admin } ) => { | ||
await admin.createNewPost(); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.deactivatePlugin( | ||
'gutenberg-test-deprecated-node-matcher' | ||
); | ||
} ); | ||
|
||
test( 'should insert block with node source', async ( { | ||
page, | ||
editor, | ||
} ) => { | ||
// await insertBlock( 'Deprecated Node Matcher' ); | ||
await editor.insertBlock( { name: 'core/deprecated-node-matcher' } ); | ||
await page.keyboard.type( 'test' ); | ||
await page.keyboard.press( 'Enter' ); | ||
expect( await editor.getEditedPostContent() ).toMatchSnapshot(); | ||
} ); | ||
|
||
test( 'should insert block with children source', async ( { | ||
page, | ||
editor, | ||
pageUtils, | ||
} ) => { | ||
// await insertBlock( 'Deprecated Children Matcher' ); | ||
await editor.insertBlock( { | ||
name: 'core/deprecated-children-matcher', | ||
} ); | ||
await page.keyboard.type( 'test' ); | ||
await page.keyboard.press( 'Enter' ); | ||
await page.keyboard.type( 'a' ); | ||
await page.keyboard.down( 'Shift' ); | ||
await page.keyboard.press( 'ArrowLeft' ); | ||
await page.keyboard.up( 'Shift' ); | ||
await pageUtils.pressKeyWithModifier( 'primary', 'b' ); | ||
expect( await editor.getEditedPostContent() ).toMatchSnapshot(); | ||
} ); | ||
} ); |