File tree Expand file tree Collapse file tree
packages/e2e-test-utils-playwright/src/editor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,26 +12,14 @@ import type { Editor } from './index';
1212export async function transformBlockTo ( this : Editor , name : string ) {
1313 await this . showBlockToolbar ( ) ;
1414
15- const switcherToggle = await this . page . waitForSelector (
15+ const switcherToggle = this . page . locator (
1616 '.block-editor-block-switcher__toggle'
1717 ) ;
18- await switcherToggle . evaluate ( ( element ) => element . scrollIntoView ( ) ) ;
19- await this . page . waitForSelector ( '.block-editor-block-switcher__toggle' , {
20- state : 'visible' ,
21- } ) ;
2218 await switcherToggle . click ( ) ;
23- await this . page . waitForSelector (
24- '.block-editor-block-switcher__container' ,
25- {
26- state : 'visible' ,
27- }
28- ) ;
2919
3020 // Find the block button option within the switcher popover.
3121 const xpath = `//*[contains(@class, "block-editor-block-switcher__popover")]//button[.='${ name } ']` ;
32- const insertButton = await this . page . waitForSelector ( xpath , {
33- state : 'visible' ,
34- } ) ;
22+ const insertButton = this . page . locator ( xpath ) ;
3523 // Clicks may fail if the button is out of view. Assure it is before click.
3624 await insertButton . evaluate ( ( element ) => element . scrollIntoView ( ) ) ;
3725 await insertButton . click ( ) ;
You can’t perform that action at this time.
0 commit comments