From 91745d6bc303721d0a1a788028cf75ad799adc31 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 10 Nov 2022 19:16:36 +0400 Subject: [PATCH] Fix performance tests --- packages/e2e-test-utils/src/inserter.js | 8 +++++--- packages/e2e-test-utils/src/list-view.js | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/e2e-test-utils/src/inserter.js b/packages/e2e-test-utils/src/inserter.js index 491543035adb9..ba11908fc4fa3 100644 --- a/packages/e2e-test-utils/src/inserter.js +++ b/packages/e2e-test-utils/src/inserter.js @@ -44,11 +44,12 @@ async function isGlobalInserterOpen() { // doesn't fail on older branches where we still had "Add block" as label. return !! document.querySelector( '.edit-post-header [aria-label="Add block"].is-pressed,' + - '.edit-site-header [aria-label="Add block"].is-pressed,' + + '.edit-site-header-edit-mode [aria-label="Add block"].is-pressed,' + '.edit-post-header [aria-label="Toggle block inserter"].is-pressed,' + '.edit-site-header [aria-label="Toggle block inserter"].is-pressed,' + '.edit-widgets-header [aria-label="Toggle block inserter"].is-pressed,' + - '.edit-widgets-header [aria-label="Add block"].is-pressed' + '.edit-widgets-header [aria-label="Add block"].is-pressed,' + + '.edit-site-header-edit-mode__inserter-toggle.is-pressed' ); } ); } @@ -64,7 +65,8 @@ export async function toggleGlobalBlockInserter() { '.edit-post-header [aria-label="Toggle block inserter"],' + '.edit-site-header [aria-label="Toggle block inserter"],' + '.edit-widgets-header [aria-label="Add block"],' + - '.edit-widgets-header [aria-label="Toggle block inserter"]' + '.edit-widgets-header [aria-label="Toggle block inserter"],' + + '.edit-site-header-edit-mode__inserter-toggle' ); } diff --git a/packages/e2e-test-utils/src/list-view.js b/packages/e2e-test-utils/src/list-view.js index 4098145dfb440..58b857652f589 100644 --- a/packages/e2e-test-utils/src/list-view.js +++ b/packages/e2e-test-utils/src/list-view.js @@ -1,13 +1,15 @@ async function toggleListView() { + // selector .edit-post-header-toolbar__list-view-toggle is still required because the performance tests also execute against older versions that still use that selector. await page.click( - '.edit-post-header-toolbar__list-view-toggle, .edit-site-header-toolbar__list-view-toggle, .edit-widgets-header-toolbar__list-view-toggle' + '.edit-post-header-toolbar__document-overview-toggle, .edit-post-header-toolbar__list-view-toggle, .edit-site-header-edit-mode__list-view-toggle, .edit-widgets-header-toolbar__list-view-toggle' ); } async function isListViewOpen() { return await page.evaluate( () => { + // selector .edit-post-header-toolbar__list-view-toggle is still required because the performance tests also execute against older versions that still use that selector. return !! document.querySelector( - '.edit-post-header-toolbar__list-view-toggle.is-pressed, .edit-site-header-toolbar__list-view-toggle.is-pressed, .edit-widgets-header-toolbar__list-view-toggle.is-pressed' + '.edit-post-header-toolbar__document-overview-toggle.is-pressed, .edit-post-header-toolbar__list-view-toggle.is-pressed, .edit-site-header-edit-mode__list-view-toggle.is-pressed, .edit-widgets-header-toolbar__list-view-toggle.is-pressed' ); } ); }