-
Notifications
You must be signed in to change notification settings - Fork 169
Playwright setup #713
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
base: master
Are you sure you want to change the base?
Playwright setup #713
Conversation
- Fix inconsistent indentation in playwright.config.ts and admin-login-auth-app.spec.ts - Add proper TypeScript type annotations - Improve code readability and structure - Maintain consistent 2-space indentation throughout - Fix test name syntax error in admin-login-auth-app.spec.ts
kasparsd
left a comment
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 is great @sudip-md! Thanks for working on this. Left some initial feedback inline.
It might be worth looking into all the e2e playwright helpers that WordPress provides as part of the Gutenberg project.
Eventually, it would be good to run these also as part of the CI pipeline.
|
|
||
| await page.goto(ADMIN_URL, { waitUntil: 'domcontentloaded' }); | ||
|
|
||
| const usernameSelector = 'input[name="log"], input#user_login, input[aria-label="Username or Email Address"]'; |
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.
There is a @wordpress/e2e-test-utils-playwright that includes all kinds of helpers for login and admin navigation. Might be useful to save on boilerplate code we need to write.
| } | ||
|
|
||
| export default defineConfig({ | ||
| testDir: './tests', |
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 if we should locate these in a subdirectory of tests to isolate them from phpunit? Ideally, the phpunit tests would also move into a subdirectory which we can do as a follow-up task.
|
There is a great blog post by @t-hamano with plenty of examples on how to use the |
|
Thanks for the ping! I'm not familiar with this project, but here are the tasks you will likely need to perform to implement Playwright in this project.
|
Closes #497
What?
I have tried to set up Playwright for E2E testing with the help of the official Playwright document.
Playwright official document - https://playwright.dev/docs/intro#installing-playwright
#497
Testing Instructions
Screenshots or screencast
Changelog Entry