From 846135567905a29e2804f890cdc8dc1c559c7473 Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Thu, 17 Oct 2024 16:36:00 +0200 Subject: [PATCH 1/2] start each test directly on the template page --- test/e2e/specs/site-editor/zoom-out.spec.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/e2e/specs/site-editor/zoom-out.spec.js b/test/e2e/specs/site-editor/zoom-out.spec.js index 2aabee07d1878..61713a8a5f9cc 100644 --- a/test/e2e/specs/site-editor/zoom-out.spec.js +++ b/test/e2e/specs/site-editor/zoom-out.spec.js @@ -12,9 +12,12 @@ test.describe( 'Zoom Out', () => { await requestUtils.activateTheme( 'twentytwentyone' ); } ); - test.beforeEach( async ( { admin, editor } ) => { - await admin.visitSiteEditor(); - await editor.canvas.locator( 'body' ).click(); + test.beforeEach( async ( { admin } ) => { + await admin.visitSiteEditor( { + postId: 'twentytwentyfour//index', + postType: 'wp_template', + canvas: 'edit', + } ); } ); test( 'Entering zoomed out mode zooms the canvas', async ( { @@ -41,6 +44,7 @@ test.describe( 'Zoom Out', () => { const paddingValue = window.getComputedStyle( element ).paddingTop; return parseFloat( paddingValue ); } ); + await page.pause(); expect( htmlRect.y + paddingTop ).toBeGreaterThan( iframeRect.y ); expect( htmlRect.x ).toBeGreaterThan( iframeRect.x ); } ); From 3b015e4e9b58db35b28c1a3bd125a47b0bbbc97e Mon Sep 17 00:00:00 2001 From: MaggieCabrera Date: Thu, 17 Oct 2024 16:41:46 +0200 Subject: [PATCH 2/2] remove pause --- test/e2e/specs/site-editor/zoom-out.spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/e2e/specs/site-editor/zoom-out.spec.js b/test/e2e/specs/site-editor/zoom-out.spec.js index 61713a8a5f9cc..464bd4a4a4efa 100644 --- a/test/e2e/specs/site-editor/zoom-out.spec.js +++ b/test/e2e/specs/site-editor/zoom-out.spec.js @@ -44,7 +44,6 @@ test.describe( 'Zoom Out', () => { const paddingValue = window.getComputedStyle( element ).paddingTop; return parseFloat( paddingValue ); } ); - await page.pause(); expect( htmlRect.y + paddingTop ).toBeGreaterThan( iframeRect.y ); expect( htmlRect.x ).toBeGreaterThan( iframeRect.x ); } );