From e67b95340e8b54cb823f90741341d3ef871eb889 Mon Sep 17 00:00:00 2001 From: Bart Kalisz Date: Wed, 24 Aug 2022 18:26:58 +0200 Subject: [PATCH] Use simpler handle getter waitForSelector implies element is visible --- test/storybook-playwright/specs/font-size-picker.test.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/storybook-playwright/specs/font-size-picker.test.ts b/test/storybook-playwright/specs/font-size-picker.test.ts index c5b43558cf96f..8bf3192d8985e 100644 --- a/test/storybook-playwright/specs/font-size-picker.test.ts +++ b/test/storybook-playwright/specs/font-size-picker.test.ts @@ -9,11 +9,10 @@ import { test, expect } from '@wordpress/e2e-test-utils-playwright'; import { gotoStoryId } from '../utils'; const waitUntilButtonHighlightStable = async ( page ) => { - const handle = await page - .locator( '[aria-label="Font size"] > div[role=presentation]' ) - .elementHandle(); + const handle = await page.waitForSelector( + '[aria-label="Font size"] > div[role=presentation]' + ); - await handle?.waitForElementState( 'visible' ); await handle?.waitForElementState( 'stable' ); return handle;