Skip to content

Commit

Permalink
Testing: Simplify the selectors for maintainability and compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshupathak95 committed Jan 24, 2025
1 parent 327aa3f commit 3655020
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/e2e/specs/editor/various/contrast-checker.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3655020

Please sign in to comment.