-
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 'sidebar permalink' e2e tests to Playwright #56253
Conversation
Co-authored-by: Pavan Patil <44057535+pavanpatil1@users.noreply.github.com>
await editor.canvas | ||
.getByRole( 'textbox', { name: 'Add title' } ) | ||
.fill( 'aaaaa' ); | ||
await editor.saveDraft(); |
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.
The editor.publishPost()
helper could fail for specific post-type configurations when the post-publish panel isn't displayed. I will double-check if not displaying the panel is intentional and fix the code accordingly.
Failing locator
const urlString = await this.page | |
.getByRole( 'region', { name: 'Editor publish' } ) | |
.getByRole( 'textbox', { name: 'address' } ) | |
.inputValue(); |
Size Change: 0 B Total Size: 1.7 MB ℹ️ View Unchanged
|
await admin.createNewPost( { postType: 'public_q_not_public' } ); | ||
await editor.openDocumentSettingsSidebar(); | ||
await editor.canvas | ||
.getByRole( 'textbox', { name: 'Add title' } ) | ||
.fill( 'aaaaa' ); | ||
await editor.publishPost(); | ||
// Start editing again. | ||
await editor.canvas | ||
.getByRole( 'textbox', { name: 'Add title' } ) | ||
.fill( 'aaaa (Updated)' ); | ||
await expect( | ||
page.getByRole( 'button', { name: 'Change URL' } ) | ||
).toBeHidden(); |
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.
Should we ensure this button is visible before the post-publish editing?
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.
Should we ensure this button is visible before the post-publish editing?
I don't think we need to do that.
The button should be rendered at all. Not sure why publishing step was included in the first place. Probably testing some regression.
await expect( | ||
page.getByRole( 'button', { name: 'Change URL' } ) | ||
).toBeHidden(); |
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.
As above!
await expect( | ||
page.getByRole( 'button', { name: 'Change URL' } ) | ||
).toBeVisible(); |
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.
As above, but the other way round 😄
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.
Looks good, just a few non-blocking comments. Thanks! 🚀
What?
Part of #38851.
Supersedes and closes #42585.
PR migrates
sidebar-permalink.test.js
e2e test to PlaywrightWhy?
See #38851.
How?
The migration is based on #42585, which I think is abandoned. I've included the author so they get credit for their contribution.
Testing Instructions