diff --git a/packages/e2e-tests/specs/editor/various/fullscreen-mode.test.js b/packages/e2e-tests/specs/editor/various/fullscreen-mode.test.js deleted file mode 100644 index 2d925e56a204a0..00000000000000 --- a/packages/e2e-tests/specs/editor/various/fullscreen-mode.test.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * WordPress dependencies - */ -import { - createNewPost, - clickOnMoreMenuItem, - toggleMoreMenu, -} from '@wordpress/e2e-test-utils'; - -describe( 'Fullscreen Mode', () => { - beforeAll( async () => { - await createNewPost(); - } ); - - it( 'should open the fullscreen mode from the more menu', async () => { - await clickOnMoreMenuItem( 'Fullscreen mode' ); - await toggleMoreMenu( 'close' ); - - const isFullscreenEnabled = await page.$eval( 'body', ( body ) => { - return body.classList.contains( 'is-fullscreen-mode' ); - } ); - - expect( isFullscreenEnabled ).toBe( true ); - - const fullscreenCloseButton = await page.$( - '.edit-post-fullscreen-mode-close' - ); - - expect( fullscreenCloseButton ).not.toBeNull(); - } ); -} ); diff --git a/test/e2e/specs/editor/various/fullscreen-mode.spec.js b/test/e2e/specs/editor/various/fullscreen-mode.spec.js new file mode 100644 index 00000000000000..8b7a0785a7ed6d --- /dev/null +++ b/test/e2e/specs/editor/various/fullscreen-mode.spec.js @@ -0,0 +1,39 @@ +/** + * WordPress dependencies + */ +const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); + +test.describe( 'Fullscreen Mode', () => { + test.beforeEach( async ( { admin } ) => { + await admin.createNewPost(); + } ); + + test.afterEach( async ( { requestUtils } ) => { + await requestUtils.deleteAllPosts(); + } ); + + test( 'should open the fullscreen mode from the more menu', async ( { + page, + } ) => { + // Open Options Menu + await page.click( + 'role=region[name="Editor top bar"i] >> role=button[name="Options"i]' + ); + + // Select Full Screen Mode + await page + .locator( 'role=menuitemcheckbox', { hasText: 'Fullscreen mode' } ) + .click(); + + // Check the body class. + await expect( page.locator( 'body' ) ).toHaveClass( + /is-fullscreen-mode/ + ); + + await expect( + page.locator( + 'role=region[name="Editor top bar"i] >> role=link[name="View Posts"i]' + ) + ).toBeVisible(); + } ); +} );