From 4e1ad123ffd49722dad233290d2906744ead1d1f Mon Sep 17 00:00:00 2001 From: Maud Leray Date: Tue, 3 Dec 2024 10:20:53 +0100 Subject: [PATCH] Remove unrelated changes These can be fixed in another PR --- tests/e2e/tools/lib/editor.js | 10 +++++++--- tests/e2e/tools/lib/post.js | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/e2e/tools/lib/editor.js b/tests/e2e/tools/lib/editor.js index 0fff628ab7..0eb2bdf662 100644 --- a/tests/e2e/tools/lib/editor.js +++ b/tests/e2e/tools/lib/editor.js @@ -1,4 +1,4 @@ -import {Locator, Page} from '@playwright/test'; // eslint-disable-line no-unused-vars +import {expect, Locator, Page} from '@playwright/test'; // eslint-disable-line no-unused-vars /** * @param {{Editor}} editor @@ -77,8 +77,12 @@ async function removeAllPostTypes({editor}) { const searchAndInsertBlock = async ({page}, blockName, namespace = '') => { // We could also use the label "Add block", // but this one works better when adding several blocks in a row. - await page.getByRole('button', {name: 'Toggle block inserter'}).click(); - await page.getByLabel('Search for blocks and patterns').click(); + const labelText = 'Toggle block inserter'; + const addBlockButton = await page.locator(`button[aria-label="${labelText}"]`); + await expect(addBlockButton).toBeVisible(); + await addBlockButton.click(); + + await page.getByPlaceholder('Search').click(); await page.keyboard.type(namespace !== '' ? namespace : blockName); if (namespace !== '') { diff --git a/tests/e2e/tools/lib/post.js b/tests/e2e/tools/lib/post.js index 125a639b3a..b2918bd5d2 100644 --- a/tests/e2e/tools/lib/post.js +++ b/tests/e2e/tools/lib/post.js @@ -65,7 +65,6 @@ async function createPostWithFeaturedImage({admin, editor}, params) { } await imageModal.getByRole('checkbox', {name: 'OCEANS-GP0STOM6C'}).click(); await imageModal.getByRole('button', {name: 'Set featured image'}).click(); - await editor.canvas.waitForSelector('.editor-post-featured-image__preview-image'); return newPost; }