From 16e99683362f2954624fe4b928e15749ffff9239 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 26 Feb 2024 10:15:28 +0400 Subject: [PATCH] Fix failing Dropdown Menu e2e tests (#59356) Co-authored-by: Mamaduka Co-authored-by: andrewserong --- test/e2e/specs/editor/various/dropdown-menu.spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/e2e/specs/editor/various/dropdown-menu.spec.js b/test/e2e/specs/editor/various/dropdown-menu.spec.js index 916ef3447d80a..4c656fd3d6994 100644 --- a/test/e2e/specs/editor/various/dropdown-menu.spec.js +++ b/test/e2e/specs/editor/various/dropdown-menu.spec.js @@ -13,9 +13,11 @@ test.describe( 'Dropdown Menu', () => { .getByRole( 'region', { name: 'Editor top bar' } ) .getByRole( 'button', { name: 'Options' } ) .click(); - const menuItems = page.locator( - '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]' - ); + const menuItems = page + .getByRole( 'menu', { name: 'Options' } ) + .locator( + '[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]' + ); const totalItems = await menuItems.count(); // Catch any issues with the selector, which could cause a false positive test result.