-
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
Refactor preview e2e tests to use Playwright. #41380
Conversation
Size Change: +1.13 kB (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
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.
Thanks for working on this!
I left some suggestions about using Playwright-style assertions. Most of them are repetitive though, just want to make sure we catch everything 😆.
There are also some places where we're not appending the i
flag to the name
s, let's remember to add them wherever they make sense ;)
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.
Missing some i
flag and some nitpicks. But overall it looks pretty good!
Remember to remove the original puppeteer test though! (We also have to remember to mention it in the migration guide 😅)
await page.locator( 'role=button[name="Switch to draft"]' ).click(); | ||
|
||
// Change the title. | ||
await editorPage.type( '[aria-label="Add title"]', ' Draft' ); |
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.
Oh, I think the name is still Add title
and the selector should work. The problem is that we're missing the "pressing OK in the dialog" action in Line 186. See my other comment there :)
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Co-authored-by: Kai Hao <kevin830726@gmail.com>
Thanks for the reviews! I think I've addressed everything now 😅 |
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 perfect! Thanks a lot 😍!
What?
Part of #38851. Migrate and refactor
preview.test.js
to Playwright. This suite has some known flaky tests so hopefully the migration fixes #37976 and #35387.Why?
See this post for an overview of the migration.
How?
By following the migration guide.
Testing Instructions
npm run test-e2e:playwright -- test/e2e/specs/editor/various/preview.spec.js
Screenshots or screencast