diff --git a/packages/e2e-test-utils-playwright/src/test.ts b/packages/e2e-test-utils-playwright/src/test.ts index c01a150602ef13..a1d533e297de06 100644 --- a/packages/e2e-test-utils-playwright/src/test.ts +++ b/packages/e2e-test-utils-playwright/src/test.ts @@ -99,7 +99,7 @@ function observeConsoleLogging( message: ConsoleMessage ) { const test = base.extend< { pageUtils: PageUtils; - snapshotConfig: void; + snapshotSuffix: void; }, { requestUtils: RequestUtils; @@ -137,19 +137,11 @@ const test = base.extend< }, { scope: 'worker' }, ], - // An automatic fixture to configure snapshot settings globally. - snapshotConfig: [ + // A work-around automatic fixture to remove the default snapshot suffix. + // See https://github.com/microsoft/playwright/issues/11134 + snapshotSuffix: [ async ( {}, use, testInfo ) => { - // A work-around to remove the default snapshot suffix. - // See https://github.com/microsoft/playwright/issues/11134 testInfo.snapshotSuffix = ''; - // Normalize snapshots into the same `__snapshots__` folder to minimize - // the file name length on Windows. - // See https://github.com/WordPress/gutenberg/issues/40291 - testInfo.snapshotDir = path.join( - path.dirname( testInfo.file ), - '__snapshots__' - ); await use(); }, diff --git a/test/e2e/specs/editor/various/copy-cut-paste.spec.js b/test/e2e/specs/editor/various/copy-cut-paste.spec.js index 01a641ef1abf1a..b6adfd758b3e07 100644 --- a/test/e2e/specs/editor/various/copy-cut-paste.spec.js +++ b/test/e2e/specs/editor/various/copy-cut-paste.spec.js @@ -68,7 +68,7 @@ test.describe( 'Copy/cut/paste', () => { await pageUtils.insertBlock( { name: 'core/spacer' } ); // At this point the spacer wrapper should be focused. await pageUtils.pressKeyWithModifier( 'primary', 'x' ); - expect( await pageUtils.getEditedPostContent() ).toBe( '' ); + expect( await pageUtils.getEditedPostContent() ).toMatchSnapshot(); // The block appender is only visible when there's no selection. await page.evaluate( () => { diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-can-copy-group-onto-non-textual-element-image-spacer-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-can-copy-group-onto-non-textual-element-image-spacer-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-can-copy-group-onto-non-textual-element-image-spacer-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-can-copy-group-onto-non-textual-element-image-spacer-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-blocks-when-non-textual-elements-are-focused-image-spacer-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-only-partial-selection-of-text-blocks-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-copy-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt diff --git a/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-1-chromium.txt new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-and-paste-individual-non-textual-blocks-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-and-merge-like-a-normal-delete---not-forward-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-partial-selection-of-text-blocks-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-cut-paste-partial-selection-with-other-blocks-in-between-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-handle-paste-events-once-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-handle-paste-events-once-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-handle-paste-events-once-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-handle-paste-events-once-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-in-places-like-input-fields-and-textareas-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-1-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-1-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-1-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-2-chromium.txt b/test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-2-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-2-chromium.txt rename to test/e2e/specs/editor/various/copy-cut-paste.spec.js-snapshots/Copy-cut-paste-should-respect-inline-copy-when-text-is-selected-2-chromium.txt diff --git a/test/e2e/specs/editor/various/__snapshots__/Post-Editor-Template-mode-Allow-creating-custom-block-templates-in-classic-themes-1-chromium.txt b/test/e2e/specs/editor/various/post-editor-template-mode.spec.js-snapshots/Post-Editor-Template-mode-Allow-creating-custom-block-templates-in-classic-themes-1-chromium.txt similarity index 100% rename from test/e2e/specs/editor/various/__snapshots__/Post-Editor-Template-mode-Allow-creating-custom-block-templates-in-classic-themes-1-chromium.txt rename to test/e2e/specs/editor/various/post-editor-template-mode.spec.js-snapshots/Post-Editor-Template-mode-Allow-creating-custom-block-templates-in-classic-themes-1-chromium.txt