-
Notifications
You must be signed in to change notification settings - Fork 3.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
chore: Remove hardcoded domain for multi-domain #19323
chore: Remove hardcoded domain for multi-domain #19323
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ FlakinessThis comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
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 work on the isAUTiframe code, looks solid
it's in another branch, but we're always injecting now
…9601) * WIP: multi domain refactor event bus * refactor multidomain setup so cy/cypress are created once and not on every page load * use unique ids per origin for logs instead of trying to sync the counter * refactor postMessage/eventBus methods into the multidomain communicator to consolidate messaging logic. Add basic JSDocs to classes and methods within the communicator. * fix issue where event data being fed into the message listener is undefined * remove forgot about commented out code * use debug to log unexpected post messages * refactor and update types * move internal:window:load to internal types * accept data argument in switchToDomain and validate arguments * add experimentalMultiDomain flag and fail switchToDomain if not enabled * add types for switchToDomain * fix types * add experimental flag * remove comment * update config suite titles and snapshots * use message in error, update test for browser family * remove unnecessary return * convert src/multidomain/index.js to typescript * use consistent naming for multi-domain * remove some data * Multidomain -> MultiDomain * address PR feedback Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
Good call. Looks like this was causing the rerun spec to fail, so it was already causing issues.
Two frameAttached and then four frameNavigated. Each frame navigates to Then they detach when the spec is re-run and it starts over with the frameAttached/frameNavigated events. After digging into how the events work a bit more, I decided it's unnecessary to listen to the frameNavigated event. We already have enough info about the tree once the frames are attached and nothing significant changes witht the frameNavigated event, so there's no need to update the tree for it. So the solution is to not debounce and only listen for frameAttached and frameDetached. This makes more calls to Page.getFrameTree than strictly necessary, but it's not going to be an exorbitant number of times (especially for a common test with no frames nested in the AUT, there will only be 2 calls). I verified that it being a singleton shouldn't be a problem because the Page.getFrameTree calls come back in order and, since any requests made before the AUT frame is attached can't be for the AUT frame itself, there's no risk of the frameTree we save being stale. |
User facing changelog
N/A - internal work for multi-domain
Additional details
Removes hard-coded domain in multi-domain implementation, so any secondary domain can be visited.
PR Tasks
cypress-documentation
?type definitions
?cypress.schema.json
?