diff --git a/test/e2e/specs/editor/various/copy-cut-paste.spec.js b/test/e2e/specs/editor/various/copy-cut-paste.spec.js index a1bb7d0c965de..43d05b967faf8 100644 --- a/test/e2e/specs/editor/various/copy-cut-paste.spec.js +++ b/test/e2e/specs/editor/various/copy-cut-paste.spec.js @@ -82,7 +82,7 @@ test.describe( 'Copy/cut/paste', () => { await editor.insertBlock( { name: 'core/spacer' } ); // At this point the spacer wrapper should be focused. await pageUtils.pressKeyWithModifier( 'primary', 'x' ); - expect( await pageUtils.getEditedPostContent() ).toBe( '' ); + expect( await editor.getEditedPostContent() ).toBe( '' ); // The block appender is only visible when there's no selection. await page.evaluate( () => { @@ -211,7 +211,7 @@ test.describe( 'Copy/cut/paste', () => { expect( await editor.getEditedPostContent() ).toBe( '' ); // Insert a non textual element (a spacer) - await pageUtils.insertBlock( { name: 'core/spacer' } ); + await editor.insertBlock( { name: 'core/spacer' } ); // Spacer is focused. await page.evaluate( () => { window.e2eTestPasteOnce = []; diff --git a/test/e2e/specs/editor/various/style-variation.spec.js b/test/e2e/specs/editor/various/style-variation.spec.js index 0f51e289a4205..9280abb8228bb 100644 --- a/test/e2e/specs/editor/various/style-variation.spec.js +++ b/test/e2e/specs/editor/various/style-variation.spec.js @@ -15,14 +15,14 @@ test.use( { test.describe( 'adding blocks', () => { test( 'Should switch to the plain style of the quote block', async ( { + admin, editor, page, - pageUtils, } ) => { - await pageUtils.createNewPost(); + await admin.createNewPost(); // Inserting a quote block - await pageUtils.insertBlock( { + await editor.insertBlock( { name: 'core/quote', attributes: { value: '
Quote content
' }, } ); @@ -32,7 +32,7 @@ test.describe( 'adding blocks', () => { await page.click( 'role=menuitem[name="Plain"i]' ); // Check the content - const content = await pageUtils.getEditedPostContent(); + const content = await editor.getEditedPostContent(); expect( content ).toBe( `diff --git a/test/e2e/specs/widgets/customizing-widgets.spec.js b/test/e2e/specs/widgets/customizing-widgets.spec.js index d1857570429a8..d14856e591d88 100644 --- a/test/e2e/specs/widgets/customizing-widgets.spec.js +++ b/test/e2e/specs/widgets/customizing-widgets.spec.js @@ -4,6 +4,7 @@ const { test, expect, + Admin, Editor, } = require( '@wordpress/e2e-test-utils-playwright' ); @@ -18,8 +19,8 @@ test.use( { editor: async ( { page }, use ) => { await use( new Editor( { page } ) ); }, - widgetsCustomizerPage: async ( { page, pageUtils }, use ) => { - await use( new WidgetsCustomizerPage( { page, pageUtils } ) ); + widgetsCustomizerPage: async ( { admin, page, pageUtils }, use ) => { + await use( new WidgetsCustomizerPage( { admin, page, pageUtils } ) ); }, } ); @@ -577,10 +578,12 @@ test.describe( 'Widgets Customizer', () => { class WidgetsCustomizerPage { /** * @param {Object} config + * @param {Admin} config.admin * @param {Page} config.page * @param {PageUtils} config.pageUtils */ - constructor( { page, pageUtils } ) { + constructor( { admin, page, pageUtils } ) { + this.admin = admin; this.page = page; this.pageUtils = pageUtils; @@ -593,7 +596,7 @@ class WidgetsCustomizerPage { } async visitCustomizerPage() { - await this.pageUtils.visitAdminPage( 'customize.php' ); + await this.admin.visitAdminPage( 'customize.php' ); // Disable welcome guide. await this.page.evaluate( () => {Quote content