From 3655020a9b675be59427c161d75fbde4a762468c Mon Sep 17 00:00:00 2001 From: himanshupathak95 Date: Fri, 24 Jan 2025 13:12:29 +0530 Subject: [PATCH] Testing: Simplify the selectors for maintainability and compatibility --- .../specs/editor/various/contrast-checker.spec.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/e2e/specs/editor/various/contrast-checker.spec.js b/test/e2e/specs/editor/various/contrast-checker.spec.js index 0606df3c81abcb..22ca667ec0b398 100644 --- a/test/e2e/specs/editor/various/contrast-checker.spec.js +++ b/test/e2e/specs/editor/various/contrast-checker.spec.js @@ -22,19 +22,13 @@ test.describe( 'ContrastChecker', () => { } ); await paragraph.click(); - await page.click( - 'button.block-editor-panel-color-gradient-settings__dropdown:has-text("Text")' - ); - await page.click( - 'button.components-circular-option-picker__option[aria-label="Black"]' - ); + await page.click( '[data-wp-component="FlexItem"]:has-text("Text")' ); + await page.click( 'button[aria-label="Black"]' ); await page.click( - 'button.block-editor-panel-color-gradient-settings__dropdown:has-text("Background")' - ); - await page.click( - 'button.components-circular-option-picker__option[aria-label="Black"]' + '[data-wp-component="FlexItem"]:has-text("Background")' ); + await page.click( 'button[aria-label="Black"]' ); const warningElement = page.locator( '.block-editor-contrast-checker' ); await expect( warningElement ).toBeVisible();