Skip to content
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: audit cross-origin related TODOs/FIXMEs #20975

Merged
merged 5 commits into from Apr 8, 2022

Conversation

chrisbreiding
Copy link
Contributor

I audited all TODOs and FIXMEs added in the feature-multidomain branch and did the following:

  • Removed it if no longer necessary
  • Added context where necessary
  • Added issue links to the comments that remain

- remove if no longer necessary
- add context where necessary
- add issue links
@chrisbreiding chrisbreiding requested review from a team as code owners April 7, 2022 19:57
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 7, 2022

Thanks for taking the time to open a PR!

@chrisbreiding chrisbreiding requested review from jennifer-shehane, mschile, AtofStryker, mjhenkes and emilyrohrbough and removed request for a team and jennifer-shehane April 7, 2022 19:57
Comment on lines -1911 to -1913
// TODO: when we find other options to put into the 'data' argument of cy.origin, we may want to overload this type with
// a 'data' parameter that contains all data options, including args, and one that contains all data options, excluding args.
// This will provide better typings support for whatever args is set to as opposed to an optional undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding correct typings is part of the acceptance criteria of any feature work, so I felt this comment wasn't needed in the code. I put it in the issue for log: false, since that should be where we add an additional property to options.

Comment on lines -1 to -4
// FIXME: sync thrown errors inside of cy.origin cause cross origin errors in firefox when using experimentalSessionSupport
// This is likely due to cypress being re declared while on a cross origin iframe before the application navigates back.
// To reproduce, just add "experimentalSessionSupport" = true into the describe block below

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This seems to be an issue with multiple tests and not just this one, so they'll all needed to be evaluated as part of this issue.

Comment on lines -152 to -153
// TODO: this currently only works on hashchange, but needs work
// for other navigation events
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This work has been done, so this comment was outdated.

Comment on lines -5 to -18
// TODO:
// - handle printing console props (need to add to runner)
// this.runner.addLog(args[0], this.config('isInteractive'))

Cypress.specBridgeCommunicator.toPrimary('log:added', LogUtils.getDisplayProps(attrs))
}

const onLogChanged = (attrs) => {
// TODO:
// - add invocation stack if error:
// let parsedError = correctStackForCrossOriginError(log.get('err'), this.userInvocationStack)
// - notify runner? maybe not
// this.runner.addLog(args[0], this.config('isInteractive'))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should all be covered in this PR.

@@ -9,7 +9,6 @@ export const handleMiscEvents = (Cypress: Cypress.Cypress, cy: $Cy) => {
Cypress.specBridgeCommunicator.toPrimary('viewport:changed', viewport)
})

// TODO: Should state syncing be built into cy.state instead of being explicitly called?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Decided we're not going to do this in a team discussion.

@@ -7,8 +7,6 @@ const onServer = function (app) {
})
}

// FIXME: This partially solves https://github.com/cypress-io/cypress/issues/19632 but only when "experimentalLoginFlows" is false.
// TODO: This will be further solved by https://github.com/cypress-io/cypress/issues/20428
describe('e2e cross origin navigation', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was handled in this PR.

@chrisbreiding chrisbreiding added the topic: cy.origin Problems or enhancements related to cy.origin command label Apr 7, 2022
@cypress
Copy link

cypress bot commented Apr 7, 2022



Test summary

20655 0 266 4Flakiness 0


Run details

Project cypress
Status Passed
Commit 071db97
Started Apr 8, 2022 6:36 PM
Ended Apr 8, 2022 6:53 PM
Duration 16:48 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


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

.closest('.command-wrapper-text')
.contains('test log')
.then(() => {
assertLogLength(logs, 3)
Copy link
Member

Choose a reason for hiding this comment

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

What should the first & the third log be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cy.origin and (new url)

Screen Shot 2022-04-08 at 9 57 38 AM

@@ -190,6 +190,7 @@ describe('navigation events', () => {
})

// TODO: this test should re revisited with the cypress in cypress tests available in 10.0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO: this test should re revisited with the cypress in cypress tests available in 10.0
// TODO: this test should revisited with the cypress in cypress tests available in 10.0

Copy link
Member

Choose a reason for hiding this comment

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

Any reason we can't add this test to the packages/runner tests? Those tests are running Cypress in Cypress in 9.x form what I can tell.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The multi-origin stuff doesn't really work with the isolated runner tests in 9.x due to there being another version of the driver in the spec bridge that's not currently taken into account in the isolated runner. It's not really worth adding the support for it in the isolated runner since it's being replaced in 10.0.

// HACK: We're telling the runnable that it has passed to avoid a timeout
// on the last (empty) command. Normally this would be set inherently by
// running runnable.run() the test. Set this to passed regardless of the
// state of the test, the runnable isn't responsible for reporting success.
Copy link
Member

Choose a reason for hiding this comment

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

what is responsible here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The runnable is the test itself, so it's passed or failed by everything in the test passing or something failing, be it a command or assertion or an error being thrown.

The runnable in the secondary driver is mostly stubbed out and its state doesn't influence the actual runnable in the primary driver.

It exists at all in the secondary driver because various parts of the driver rely on it having certain properties and methods. Ideally, it wouldn't need to exist in the secondary driver at all, but removing that would potentially mean a fairly broad refactor of the driver. For the sake of completing the experimental release and reducing the broader impact of the cross-origin support changes, we've not done that as of yet.

We plan to refactor and optimize the code that goes into the secondary driver, so we might be able to refactor out the need for the runnable in the secondary driver as part of that effort.

@chrisbreiding chrisbreiding merged commit f6975f8 into feature-multidomain Apr 8, 2022
@chrisbreiding chrisbreiding deleted the md-todos-fixmes branch April 8, 2022 19:11
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.

None yet

4 participants