-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Playwright e2e utils: add new emulateNetworkConditions
helper
#69865
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
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
LGTM, but I'm not familiar with Playwright.
packages/e2e-test-utils-playwright/src/page-utils/emulate-network-conditions.ts
Outdated
Show resolved
Hide resolved
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.
@swissspidy Looks great!
Will you open separate PRs to actually use this in the Gutenberg and Core Performance tests?
Yes, once this is released on npm |
…ork-conditions.ts Co-authored-by: Weston Ruter <westonruter@google.com>
…Press#69865) Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: westonruter <westonruter@git.wordpress.org> Co-authored-by: felixarntz <flixos90@git.wordpress.org>
What?
Adds a new
PageUtils.emulateNetworkConditions()
helper to emulate network conditions such as Slow 3G, Fast 4G or Broadband.Why?
For performance tests in Gutenberg and core it would be nice if we'd be able to not only simulate mobile viewports, but also mobile network conditions. And even for desktop we want to use some realistic conditions that are aligned with what other tools such as Lighthouse use.
How?
Testing Instructions
In a test you should be able to use the
pageUtils
fixture and then doawait pageUtils.emulateNetworkConditions( 'Fast 4G' );
.Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A