diff --git a/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts b/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts index 6eaa6832d7..755f74b20a 100644 --- a/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts +++ b/e2e-tests/specs/customizer/general/custom-global-colors.spec.ts @@ -33,10 +33,12 @@ test.describe('Custom Global Color Control', () => { ); await clearWelcome(page); - await page.waitForTimeout( 200 ); - await page.locator( '.block-editor-default-block-appender__content' ).click(); - - await page.locator('.block-editor-rich-text__editable').first().click(); + const iframeElement = await page.waitForSelector('iframe'); + const frame = await iframeElement.contentFrame(); + if (frame) { + await frame.waitForSelector('.block-editor-rich-text__editable'); + await frame.locator('.block-editor-rich-text__editable').first().click(); + } // use Background color control to open the color picker, available since WP 6.1 await page.getByRole('button', { name: 'Background' }).click(); await page.getByRole('option', { name: 'Color: Custom 1' }).click();