cy.intercept() and cy.visit() #28171
Unanswered
willowloveforever
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions