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

Force cy.origin to use same origin instead of same super domain origin #23999

Closed
AtofStryker opened this issue Sep 27, 2022 · 4 comments · Fixed by #23885
Closed

Force cy.origin to use same origin instead of same super domain origin #23999

AtofStryker opened this issue Sep 27, 2022 · 4 comments · Fixed by #23885
Assignees
Labels
topic: cy.origin Problems or enhancements related to cy.origin command

Comments

@AtofStryker
Copy link
Contributor

What would you like?

I would like to force cy.origin spec bridges to create the iframe source as the same origin as the expected AUT.

In other words:

// moving away from the primary
cy.visit('https://www.foobar.com/index.html')
cy.origin('https://foobar.com', () => // your code here)

becomes

// moving away from the primary
cy.visit('https://www.foobar.com/index.html')
cy.origin('https://www.foobar.com', () => // your code here)

Why is this needed?

In order to support google login from google chrome and eliminate inconsistencies from the spec bridge. This means requests can be relative from within the cy.origin block, as well as actually being able to leverage more accurate properties off the window object (like origin). This also simplifies the check inside the injection to just compare origins and move on

Other

No response

@AtofStryker AtofStryker added topic: cy.origin Problems or enhancements related to cy.origin command and removed stage: internal labels Sep 27, 2022
@AtofStryker
Copy link
Contributor Author

NOTE: This is a breaking change for cy.origin, but does NOT require a major release as it is behind an experimental flag

@AtofStryker AtofStryker self-assigned this Sep 27, 2022
@AtofStryker
Copy link
Contributor Author

We also need to make sure documentation is added to cypress-documentation to explain this breaking change before releasing

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 4, 2022

The code for this is done in cypress-io/cypress#23885, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2022

Released in 10.10.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.10.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: cy.origin Problems or enhancements related to cy.origin command
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant