Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Fullscreen mode test to Playwright #43963

Merged
merged 10 commits into from
Oct 25, 2022
31 changes: 0 additions & 31 deletions packages/e2e-tests/specs/editor/various/fullscreen-mode.test.js

This file was deleted.

39 changes: 39 additions & 0 deletions test/e2e/specs/editor/various/fullscreen-mode.spec.js
Original file line number Diff line number Diff line change
@@ -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();
} );
} );