Cypress · Junior · Question 19 of 75

Which assertion checks an input's value?

Show the answer

Correct answer: .should('have.value', 'John')

Explanation

Input values aren't text content. have.value reads the current value; have.text reads text nodes.

Further reading

Problem with a question

Cypress · Junior · question 19

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