-
Notifications
You must be signed in to change notification settings - Fork 2
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
Cypress doesn't wait for idle timeout #54
Conversation
…es are there when navigating to the page
…s member, since it's only used in one method
… it doesn't need access to other class variables
@@ -1,9 +1,6 @@ | |||
import type { Page } from 'playwright'; |
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.
Nice! We just need to get that Playwright protocol out of here now!
// tack on the protocol so we can properly check if requests are cross-origin | ||
this.allowedArchiveOrigins = (allowedDomains || []).map((domain) => `https://${domain}`); | ||
} | ||
|
||
async watch() { | ||
this.client.on('Network.requestWillBeSent', this.requestWillBeSent.bind(this)); |
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.
Are these unnecessary?
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.
Ah I see below that the handlers only logged 👍
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.
Yeah, these only logged, and in fact they didn't end up getting fired when I put in the logger.
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!
🚀 PR was released in |
What Changed
Cypress doesn't wait 10 seconds (the global timeout amount) to finish tests anymore.
Instead of using the
Watcher.idle()
to know when Cypress archives can be complete, I'm not waiting at all. This is becausecy.visit()
(the command to visit a page) already waits for all resources to be loaded before it completes.This also means users' Cypress tests aren't any slower when they add Chromatic since we're not waiting a minimum of
500ms
after each test.Also changed
Watcher.idle()
is pulled out and into the Playwright-specific code since 1) Cypress doesn't need it and 2) it doesn't need access to anyWatcher
class variablesWatcher
methods that were either 1) unused (setResponse()
) or 2) were only used for logging and weren't actually ever even hit (requestWillBeSent()
andresponseReceived()
)How to test
Change Type
maintenance
documentation
patch
minor
major
📦 Published PR as canary version:
0.0.55--canary.54.b107684.0
✨ Test out this PR locally via:
npm install @chromaui/test-archiver@0.0.55--canary.54.b107684.0 # or yarn add @chromaui/test-archiver@0.0.55--canary.54.b107684.0