Commit cb2cb81 1 parent d159849 commit cb2cb81 Copy full SHA for cb2cb81
File tree 1 file changed +2
-14
lines changed
packages/e2e-test-utils-playwright/src/editor
1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,14 @@ import type { Editor } from './index';
12
12
export async function transformBlockTo ( this : Editor , name : string ) {
13
13
await this . showBlockToolbar ( ) ;
14
14
15
- const switcherToggle = await this . page . waitForSelector (
15
+ const switcherToggle = this . page . locator (
16
16
'.block-editor-block-switcher__toggle'
17
17
) ;
18
- await switcherToggle . evaluate ( ( element ) => element . scrollIntoView ( ) ) ;
19
- await this . page . waitForSelector ( '.block-editor-block-switcher__toggle' , {
20
- state : 'visible' ,
21
- } ) ;
22
18
await switcherToggle . click ( ) ;
23
- await this . page . waitForSelector (
24
- '.block-editor-block-switcher__container' ,
25
- {
26
- state : 'visible' ,
27
- }
28
- ) ;
29
19
30
20
// Find the block button option within the switcher popover.
31
21
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 ) ;
35
23
// Clicks may fail if the button is out of view. Assure it is before click.
36
24
await insertButton . evaluate ( ( element ) => element . scrollIntoView ( ) ) ;
37
25
await insertButton . click ( ) ;
You can’t perform that action at this time.
0 commit comments