Using an alias within a condition before it has been registered #22960
Unanswered
teststack-git
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.
-
Is there a way to utilize aliases in a condition? In essence, I am attempting generate a token and store it as an alias, however I only want to generate the token if the alias does not yet exist. I'm looking to implement something like this or similar:
if(cy.get('@tokenAlias')===null) { do something }
The obvious problem is that '@tokenAlias' has not been defined and hence throws an alias not registered error.
Beta Was this translation helpful? Give feedback.
All reactions