sir-dunxalot / cypress-nextjs-auth0

Cypress commands to support Auth0 and Next.js
60 stars 24 forks source link

The login command will always "choose to relog" and remove cookies #25

Open maorRoz opened 3 years ago

maorRoz commented 3 years ago

My tests always try to "clear cookies" and relog to the auth0. after I went through the code of the "login" command carefully it seems to me pretty clear why:

It seems that the cachedUsername variable is never being set to some value and left undefined through the whole life-cycle of the code. therefore the code will always execute the clear cookies + relog flow no matter what.

I'm talking about the code here: https://github.com/sir-dunxalot/cypress-nextjs-auth0/blob/master/src/commands/login.js