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

10.3 broke support for oauth flow with Spotify #22674

Closed
SilverLinings89 opened this issue Jul 4, 2022 · 3 comments · Fixed by #22594
Closed

10.3 broke support for oauth flow with Spotify #22674

SilverLinings89 opened this issue Jul 4, 2022 · 3 comments · Fixed by #22594
Assignees

Comments

@SilverLinings89
Copy link

Current behavior

We have a test that redirects a user to Spotify to login, performs the login there and then returns on success. This test worked will in 10.2 but fails in 10.3.
We navigate to the login page using cy.origin and receive an error
image

Desired behavior

This worked before.

Test code to reproduce

Basically:

cy.origin + visit to https://accounts.spotify.com/en/login (the exact url depends on the app you have registered and the callback you use)
cy.get('input#login-username').click().type(email);
cy.get('input#login-password').click().type(spotifyPw);
cy.get('#login-button').click();
-> in 10.2 this works like a charm, in 10.3 it fails with the message in the image above "Oops! Something went wrong, please try again or check out our help area"

Cypress Version

10.3

Other

The form uses a post request that failes with an error code 400.
POST https://accounts.spotify.com/login/password 400 (Bad Request)

From the changelog of version 10.3 I would suspect this to be related to this:
Updated cross-origin cookie handling to align with browser behavior. This fixed various issues with cookies when testing across multiple origins. Fixed #21363 and #20685.

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 11, 2022
@chrisbreiding chrisbreiding self-assigned this Jul 11, 2022
@chrisbreiding
Copy link
Contributor

I confirmed this fails in 10.3.0 with the following:

  it('logs in with spotify', () => {
    cy.origin('spotify.com', () => {
      cy.visit('https://accounts.spotify.com/en/login')
      cy.get('input#login-username').click().type(Cypress.env('spotify-username'))
      cy.get('input#login-password').click().type(Cypress.env('spotify-password'))
      cy.get('#login-button').click()
    })
  })

My hunch is that this is related to spotify using document.cookie to check if cookies are enabled. I checked and confirmed that this is fixed by #22594, so I think my hunch is correct.

This issue will be resolved in the next release of Cypress, which will be this week or next week at the latest.

@chrisbreiding chrisbreiding removed the stage: investigating Someone from Cypress is looking into this label Jul 11, 2022
@SilverLinings89
Copy link
Author

Thank you very much for your effort, I will evaluate this once the release is out and give feedback :)

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 19, 2022

Released in 10.3.1.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jul 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants