Hello world!
' ); // Change the `drop cap` using the sidebar. + await openTypographyToolsPanelMenu(); + await page.click( 'button[aria-label="Show Drop cap"]' ); + const [ dropCapToggle ] = await page.$x( "//label[contains(text(), 'Drop cap')]" ); diff --git a/packages/e2e-tests/specs/editor/various/font-size-picker.test.js b/packages/e2e-tests/specs/editor/various/font-size-picker.test.js index 7e405330fb717..8f90b9c40c51e 100644 --- a/packages/e2e-tests/specs/editor/various/font-size-picker.test.js +++ b/packages/e2e-tests/specs/editor/various/font-size-picker.test.js @@ -8,6 +8,7 @@ import { pressKeyWithModifier, pressKeyTimes, activateTheme, + openTypographyToolsPanelMenu, } from '@wordpress/e2e-test-utils'; const openFontSizeSelectControl = async () => { @@ -17,13 +18,6 @@ const openFontSizeSelectControl = async () => { return selectControl.click(); }; -const openTypographyToolsPanelMenu = async () => { - const toggleSelector = - "//div[contains(@class, 'typography-block-support-panel')]//button[contains(@class, 'components-dropdown-menu__toggle')]"; - const toggle = await page.waitForXPath( toggleSelector ); - return toggle.click(); -}; - const FONT_SIZE_TOGGLE_GROUP_SELECTOR = "//div[contains(@class, 'components-font-size-picker__controls')]//div[contains(@class, 'components-toggle-group-control')]"; diff --git a/packages/e2e-tests/specs/widgets/customizing-widgets.test.js b/packages/e2e-tests/specs/widgets/customizing-widgets.test.js index 58a917508c11e..dec762a39da59 100644 --- a/packages/e2e-tests/specs/widgets/customizing-widgets.test.js +++ b/packages/e2e-tests/specs/widgets/customizing-widgets.test.js @@ -10,6 +10,7 @@ import { clickBlockToolbarButton, deleteAllWidgets, createURL, + openTypographyToolsPanelMenu, } from '@wordpress/e2e-test-utils'; /** @@ -831,6 +832,9 @@ describe( 'Widgets Customizer', () => { await showMoreSettingsButton.click(); // Change `drop cap` (Any change made in this section is sufficient; not required to be `drop cap`). + await openTypographyToolsPanelMenu(); + await page.click( 'button[aria-label="Show Drop cap"]' ); + const [ dropCapToggle ] = await page.$x( "//label[contains(text(), 'Drop cap')]" );