-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Gallery tests to Playwright #45202
Conversation
Size Change: +1.92 kB (0%) Total Size: 1.28 MB
ℹ️ View Unchanged
|
Odd, tests are passing for me locally without an issue. I will continue debugging on Monday. |
const gallery = page.locator( 'role=document[name="Block: Gallery"i]' ); | ||
|
||
await expect( gallery ).toBeVisible(); | ||
await editor.selectBlocks( gallery ); |
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.
I had to use editor.selectBlocks()
util. Selecting a Gallery block using page.click()
isn't reliable, it can easily select an inner image block.
The tests are passing without an issues now. This is ready for the review. |
// | ||
// Attempts to add an Axe exception for the media modal haven't proved | ||
// successful: | ||
// https://github.com/WordPress/gutenberg/pull/22719 |
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.
I wonder of we should copy across the full details of this test so there is a record of what it was supposed to do if the Axe issue can be resolved, eg. the following seems to work locally:
test.fixme(
'when initially added the media library shows the Create Gallery view',
async ( { admin, editor, page } ) => {
await admin.createNewPost();
await editor.insertBlock( { name: 'core/gallery' } );
await page.click( 'role=button[name="Media Library"i]' );
await page.waitForSelector( '.media-frame' );
expect( await page.innerText( '.media-frame-title h1' ) ).toBe(
'Create gallery'
);
expect(
await page.innerText( '.media-toolbar-primary button' )
).toBe( 'Create a new gallery' );
}
);
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.
Makes sense. Done in 926c24f.
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.
I don't think we're still running Axe test in Playwright, which is what I missed in the first place. But this probably also means that this test should pass now that Axe is out of the way?
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.
I can double-check this and re-enable the test. Thanks for the info, @kevin940726.
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.
This tested well for me - didn't see any failures when running locally.
Thanks for testing, @glendaviesnz 🙇 I'm going to merge this. PHP Unit failures are unrelated. See #45254. |
What?
Part of #38851.
PR migrates Gallery
captione2e tests to Playwright.Why?
These tests started failing a lot recently. We already had a Gallery test in the Playwright suite, so I did a
partialmigration.P.S. I migrated skipped test with a
fixme
mark.How?
Testing Instructions