-
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 multiple block stylesheets' tests to Playwright (#55003
- Loading branch information
Showing
3 changed files
with
42 additions
and
65 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
58 changes: 0 additions & 58 deletions
58
packages/e2e-tests/specs/editor/plugins/iframed-multiple-block-stylesheets.test.js
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
test/e2e/specs/editor/plugins/iframed-multiple-block-stylesheets.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,42 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
||
test.describe( 'iframed multiple block stylesheets', () => { | ||
test.beforeAll( async ( { requestUtils } ) => { | ||
await requestUtils.activatePlugin( | ||
'gutenberg-test-iframed-multiple-stylesheets' | ||
); | ||
} ); | ||
|
||
test.beforeEach( async ( { admin } ) => { | ||
await admin.createNewPost( { postType: 'page' } ); | ||
} ); | ||
|
||
test.afterAll( async ( { requestUtils } ) => { | ||
await requestUtils.deactivatePlugin( | ||
'gutenberg-test-iframed-multiple-stylesheets' | ||
); | ||
} ); | ||
|
||
test( 'should load multiple block stylesheets in iframe', async ( { | ||
editor, | ||
} ) => { | ||
await editor.insertBlock( { | ||
name: 'test/iframed-multiple-stylesheets', | ||
} ); | ||
const block = editor.canvas.getByRole( 'document', { | ||
name: 'Block: Iframed Multiple Stylesheets', | ||
} ); | ||
|
||
await expect( block ).toBeVisible(); | ||
|
||
// Style loaded from the main stylesheet. | ||
await expect( block ).toHaveCSS( 'border-style', 'dashed' ); | ||
// Style loaded from the additional stylesheet. | ||
await expect( block ).toHaveCSS( 'border-color', 'rgb(255, 0, 0)' ); | ||
// Style loaded from the a stylesheet using path instead of handle. | ||
await expect( block ).toHaveCSS( 'border-color', 'rgb(255, 0, 0)' ); | ||
} ); | ||
} ); |
8a5dd61
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 8a5dd61.
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/6404274826
📝 Reported issues:
/test/e2e/specs/widgets/customizing-widgets.spec.js