Skip to content

Conversation

@mjhenkes
Copy link
Contributor

User facing changelog

n/a

Additional details

This PR improves our error message for timeouts due to multi-domain

  • Errors now include the origin we expected the page to load on as well as the request itself.
  • Clean up lost page load timeouts that were getting thrown after a test finished.
  • Page load timeouts thrown from secondary domain are no-longer wrapped as if they were a user spec error.
  • Spec bridges now listen to the websocket
  • Moved errors from basic auth to navigation.

Error TODOS:
Better error when a command expects to run on one origin but it is run against another origin.

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@mjhenkes mjhenkes added the topic: cy.origin Problems or enhancements related to cy.origin command label Mar 17, 2022
@mjhenkes mjhenkes requested a review from a team as a code owner March 17, 2022 20:40
@mjhenkes mjhenkes self-assigned this Mar 17, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 17, 2022

Thanks for taking the time to open a PR!

@mjhenkes mjhenkes removed the request for review from a team March 17, 2022 20:40
If so, increase \`redirectionLimit\` value in configuration.`
},
switch_to_domain_load_timed_out ({ ms, configFile, crossOriginUrl, origins }) {
return stripIndent`\
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error message suggestions are greatly appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW so far I really like where this has landed

@cypress
Copy link

cypress bot commented Mar 18, 2022



Test summary

20490 0 295 4Flakiness 4


Run details

Project cypress
Status Passed
Commit 44bc36f
Started Mar 21, 2022 4:31 PM
Ended Mar 21, 2022 4:46 PM
Duration 14:58 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

e2e/multi-domain/navigation_spec.ts Flakiness
1 delayed navigation > localhost -> foobar, delay in
2 errors > never redirects to the subdomain
reporter.hooks.spec.js Flakiness
1 hooks > can rerun without timeout error leaking into next run (due to run restart)
cypress/proxy-logging_spec.ts Flakiness
1 Proxy Logging > request logging > xhr log has response body/status code when xhr response is logged second

This 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

@AtofStryker AtofStryker self-requested a review March 21, 2022 14:07
If so, increase \`redirectionLimit\` value in configuration.`
},
switch_to_domain_load_timed_out ({ ms, configFile, crossOriginUrl, origins }) {
return stripIndent`\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW so far I really like where this has landed

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
Timed out after waiting \`${ms}ms\` for your remote page to load on origin(s):
${origins.map((origin) => `\`${origin}\``).join('\n ')}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
${origins.map((origin) => `\`${origin}\``).join('\n ')}
- ${origins.map((origin) => `\`${origin}\``).join('\n - ')}

Make them list items?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine, but wanted to point out that the items will have the dash, we don't seem to do any list item markdown conversion (i tried * previously)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's an example of there being multiple origins?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning ahead for nested switchToDomains. Where you may want to return to any of the parent domains.

@AtofStryker AtofStryker self-requested a review March 21, 2022 16:36
@mjhenkes mjhenkes requested a review from mschile March 21, 2022 16:59
@mjhenkes mjhenkes merged commit 9827b26 into feature-multidomain Mar 21, 2022
@mjhenkes mjhenkes deleted the md-page-timeout-error-message branch March 21, 2022 17:55
mschile pushed a commit that referenced this pull request Mar 22, 2022
* Better timeout error handling

* quick fix, should re-visit

* cancel dangling timeouts

* re-broadcast the window load event.

* clean up code and comment more

* ignore better

* PR updates

* oops, didn't mean to enable this

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* moar pr updates

* Apply suggestions from code review

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Fix test

* message changes

* message update

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: cy.origin Problems or enhancements related to cy.origin command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants