Cypress · Junior · Question 28 of 75

What does .as('user') do?

Show the answer

Correct answer: Creates an alias you can reuse with @user

Explanation

Aliases work for elements, values and intercepted requests: cy.get('@user') or cy.wait('@getUser').

Further reading

Problem with a question

Cypress · Junior · question 28

Test yourself

Take the Cypress · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz