diff --git a/packages/e2e-tests/specs/editor/plugins/__snapshots__/deprecated-node-matcher.test.js.snap b/packages/e2e-tests/specs/editor/plugins/__snapshots__/deprecated-node-matcher.test.js.snap deleted file mode 100644 index d36c990c04c37d..00000000000000 --- a/packages/e2e-tests/specs/editor/plugins/__snapshots__/deprecated-node-matcher.test.js.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Deprecated Node Matcher should insert block with children source 1`] = ` -" -

test
a

-" -`; - -exports[`Deprecated Node Matcher should insert block with node source 1`] = ` -" -

test

-" -`; diff --git a/packages/e2e-tests/specs/editor/plugins/deprecated-node-matcher.test.js b/packages/e2e-tests/specs/editor/plugins/deprecated-node-matcher.test.js deleted file mode 100644 index 21b587a00c28b4..00000000000000 --- a/packages/e2e-tests/specs/editor/plugins/deprecated-node-matcher.test.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * WordPress dependencies - */ -import { - activatePlugin, - createNewPost, - deactivatePlugin, - getEditedPostContent, - insertBlock, - pressKeyWithModifier, -} from '@wordpress/e2e-test-utils'; - -describe( 'Deprecated Node Matcher', () => { - beforeAll( async () => { - await activatePlugin( 'gutenberg-test-deprecated-node-matcher' ); - } ); - - beforeEach( async () => { - await createNewPost(); - } ); - - afterAll( async () => { - await deactivatePlugin( 'gutenberg-test-deprecated-node-matcher' ); - } ); - - it( 'should insert block with node source', async () => { - await insertBlock( 'Deprecated Node Matcher' ); - await page.keyboard.type( 'test' ); - await page.keyboard.press( 'Enter' ); - expect( await getEditedPostContent() ).toMatchSnapshot(); - } ); - - it( 'should insert block with children source', async () => { - await insertBlock( '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 pressKeyWithModifier( 'primary', 'b' ); - expect( await getEditedPostContent() ).toMatchSnapshot(); - } ); -} ); diff --git a/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-children-source-1-chromium.txt b/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-children-source-1-chromium.txt new file mode 100644 index 00000000000000..469b0e769f04bd --- /dev/null +++ b/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-children-source-1-chromium.txt @@ -0,0 +1,3 @@ + +

test
a

+ \ No newline at end of file diff --git a/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-node-source-1-chromium.txt b/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-node-source-1-chromium.txt new file mode 100644 index 00000000000000..4e5daa5abfffec --- /dev/null +++ b/test/e2e/specs/editor/plugins/__snapshots__/Deprecated-Node-Matcher-should-insert-block-with-node-source-1-chromium.txt @@ -0,0 +1,3 @@ + +

test

+ \ No newline at end of file diff --git a/test/e2e/specs/editor/plugins/deprecated-node-matcher.spec.js b/test/e2e/specs/editor/plugins/deprecated-node-matcher.spec.js new file mode 100644 index 00000000000000..fd57954e9905da --- /dev/null +++ b/test/e2e/specs/editor/plugins/deprecated-node-matcher.spec.js @@ -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(); + } ); +} );