Skip to content

Commit

Permalink
Revert "Move Playwright snapshots into the same local folder (#40336)" (
Browse files Browse the repository at this point in the history
#40412)

This reverts commit 1fc751c.
  • Loading branch information
oandregal authored Apr 18, 2022
1 parent c135816 commit 33a5d51
Show file tree
Hide file tree
Showing 23 changed files with 5 additions and 13 deletions.
16 changes: 4 additions & 12 deletions packages/e2e-test-utils-playwright/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function observeConsoleLogging( message: ConsoleMessage ) {
const test = base.extend<
{
pageUtils: PageUtils;
snapshotConfig: void;
snapshotSuffix: void;
},
{
requestUtils: RequestUtils;
Expand Down Expand Up @@ -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();
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/specs/editor/various/copy-cut-paste.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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( () => {
Expand Down

0 comments on commit 33a5d51

Please sign in to comment.