From 90ab11458ae32d59f42208d33458343eb1e2ee3b Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Wed, 14 Jun 2023 18:32:41 +0900 Subject: [PATCH] Try to fix performance test failure on trunk (#51407) * Try to fix performance test failure * Use more semantic manipulation * Revert unnecessary changes --- .../specs/performance/site-editor.test.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/e2e-tests/specs/performance/site-editor.test.js b/packages/e2e-tests/specs/performance/site-editor.test.js index e8f705c6dc0d79..c141c2dbf58672 100644 --- a/packages/e2e-tests/specs/performance/site-editor.test.js +++ b/packages/e2e-tests/specs/performance/site-editor.test.js @@ -142,17 +142,21 @@ describe( 'Site Editor Performance', () => { postType: 'page', } ); - // Wait for the first paragraph to be ready. - const firstParagraph = await canvas().waitForXPath( - '//p[contains(text(), "Lorem ipsum dolor sit amet")]' - ); + // Wait for the first block to be ready. + await canvas().waitForSelector( '.wp-block' ); // Get inside the post content. await enterEditMode(); - // Insert a new paragraph right under the first one. - await firstParagraph.click(); // Once to select the block overlay. - await firstParagraph.click(); // Once again to select the paragraph. + // Select the post content block wrapper. + await canvas().click( '.wp-block-post-content' ); + + // Select the first paragraph in the post content block. + const firstParagraph = await canvas().waitForXPath( + '//p[contains(text(), "Lorem ipsum dolor sit amet")]' + ); + await firstParagraph.click(); + await insertBlock( 'Paragraph' ); // Start tracing.