Skip to content

Commit

Permalink
Migrate Fullscreen mode test to Playwright (#43963)
Browse files Browse the repository at this point in the history
* Add Full Screen Test case

* Remove old migrated file

* Modify Locator

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Update test/e2e/specs/editor/various/fullscreen-mode.spec.js

Co-authored-by: George Mamadashvili <[email protected]>

* Addressed Feedback

Co-authored-by: George Mamadashvili <[email protected]>
  • Loading branch information
alvitazwar and Mamaduka authored Oct 25, 2022
1 parent f890071 commit f808cff
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 31 deletions.
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();
} );
} );

0 comments on commit f808cff

Please sign in to comment.