Repository navigation
Migrate 'iframed inline styles' tests to Playwright - #55009
Conversation
| add_action( | ||
| 'setup_theme', | ||
| static function () { | ||
| add_theme_support( 'block-templates' ); | ||
| } | ||
| ); | ||
|
|
There was a problem hiding this comment.
This is no longer needed as the editor canvas renders in iframed by default now.
| const { test, expect } = require( '@wordpress/e2e-test-utils-playwright' ); | ||
|
|
||
| test.describe( 'iframed inline styles', () => { | ||
| test.describe( 'iframed enqueue block assets', () => { |
There was a problem hiding this comment.
I missed that there was a copy/paste issue when migrating this test.
|
Size Change: 0 B Total Size: 1.62 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 2e30e58. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6394106292
|
| '2px' | ||
| ); | ||
|
|
||
| await createNewTemplate( 'Iframed Test' ); |
There was a problem hiding this comment.
What did this do? Should we port it to Playwright too?
There was a problem hiding this comment.
This was used to switch to an iframed editor. The step is no longer needed as the iframed editor is the new default since WP 6.3.
|
|
||
| // Inline styles of stylesheet loaded with the compatibility layer should load. | ||
| await expect( block ).toHaveCSS( 'border-width', '2px' ); | ||
| expect( hasWarning ).toBe( true ); |
There was a problem hiding this comment.
It will be nice to at least know what warnings are being thrown, but not required in this PR as a part of the migration.
There was a problem hiding this comment.
I also wanted to do that, but I decided to stick with linear migration for now 😅 Happy to follow up if this causes any flaky test reports.
By the way, Can we loosely assert array strings? e.g., Confirm array has value containing 'example' string?
There was a problem hiding this comment.
Yep! I think we can do .toEqual( expect.arrayContaining( [ ...stuff ] ) ).
|
Thanks for the review, @kevin940726! |
What?
Part of #38851.
Closes #35172.
PR migrates 'iframed inline styles' tests to Playwright.
Why?
The test has been failing more often lately.
Testing Instructions