-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate 'iframed masonry block' tests to Playwright (#55016)
* Migrate 'iframed masonry block' tests to Playwright * Remove old test files * Use boundingBox
- Loading branch information
Showing
4 changed files
with
44 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
packages/e2e-tests/specs/editor/plugins/__snapshots__/iframed-masonry-block.test.js.snap
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
packages/e2e-tests/specs/editor/plugins/iframed-masonry-block.test.js
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
test/e2e/specs/editor/plugins/iframed-masonry-block.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'iframed masonry block', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activatePlugin( | ||
'gutenberg-test-iframed-masonry-block' | ||
); | ||
} ); | ||
|
||
test.beforeEach( async ( { admin } ) => { | ||
await admin.createNewPost(); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.deactivatePlugin( | ||
'gutenberg-test-iframed-masonry-block' | ||
); | ||
} ); | ||
|
||
test( 'should load script and dependencies in iframe', async ( { | ||
editor, | ||
} ) => { | ||
await editor.insertBlock( { name: 'test/iframed-masonry-block' } ); | ||
|
||
const masonry = editor.canvas.getByRole( 'document', { | ||
name: 'Block: Iframed Masonry Block', | ||
} ); | ||
await expect( masonry ).toBeVisible(); | ||
|
||
const masonryBox = await masonry.boundingBox(); | ||
|
||
// Expect Masonry to set a non-zero height. | ||
expect( masonryBox.height ).toBeGreaterThan( 0 ); | ||
|
||
// Expect Masonry to absolute position items. | ||
await expect( masonry.locator( '.grid-item' ).first() ).toHaveCSS( | ||
'position', | ||
'absolute' | ||
); | ||
} ); | ||
} ); |
8f80a11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 8f80a11.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6401720809
📝 Reported issues:
/test/e2e/specs/editor/various/multi-block-selection.spec.js