From b64d0ae88f892e2f13720c1dae0f41b788805d54 Mon Sep 17 00:00:00 2001 From: Ella <4710635+ellatrix@users.noreply.github.com> Date: Fri, 5 Jul 2024 21:22:40 +0300 Subject: [PATCH] Perf tests: make pages test compatible with base branch (#63204) Co-authored-by: ellatrix Co-authored-by: youknowriad --- test/performance/specs/site-editor.spec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/performance/specs/site-editor.spec.js b/test/performance/specs/site-editor.spec.js index 7b890a4c06775..58f2cf5cd4b4e 100644 --- a/test/performance/specs/site-editor.spec.js +++ b/test/performance/specs/site-editor.spec.js @@ -416,6 +416,12 @@ test.describe( 'Site Editor Performance', () => { } ) ); + await admin.visitSiteEditor(); + await page.getByRole( 'button', { name: 'Pages' } ).click(); + + // Check if we're dealing with the old URL structure. + const path = new URL( page.url() ).searchParams.get( 'path' ); + const samples = 10; for ( let i = 1; i <= samples; i++ ) { // Start from the trash view, then navigate to all pages, so we @@ -423,7 +429,9 @@ test.describe( 'Site Editor Performance', () => { // For some reason `visiSiteEditor` does not work with these // parameters. await admin.visitAdminPage( - 'site-editor.php?postType=page&layout=table&activeView=trash' + path + ? 'site-editor.php?path=%2Fpage&layout=table&activeView=trash' + : 'site-editor.php?postType=page&layout=table&activeView=trash' ); const startTime = performance.now();