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

cy.intercept() and cy.visit() #5549

Closed
mayinlu opened this issue Oct 28, 2023 · 1 comment
Closed

cy.intercept() and cy.visit() #5549

mayinlu opened this issue Oct 28, 2023 · 1 comment

Comments

@mayinlu
Copy link

mayinlu commented Oct 28, 2023

Subject

cypress use

Description

Hello, I am writing login logic using cypress. I used cy.request in beforeEach to obtain the token, and used cy.intercept to place the token in the authorization attribute of the header of all interfaces in test. test. com/api/* /. Then I use cy.visit in it to request that the homepage product. product page has a default request to obtain data and load the product page. But these requests were all reported incorrectly. I checked that the header in Matched 'cy. intercept()' has authorization. But there is no authorization in the actual request headers. May I ask what I should do. thanks.

@jennifer-shehane
Copy link
Member

Duplicate #5550

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants