Playwright · Junior · Question 34 of 75

Which assertion checks the current value of an input?

Show the answer

Correct answer: await expect(input).toHaveValue('john@x.io')

Explanation

Input values aren't text content, so toHaveText won't see them. toHaveValue reads the live value property.

Further reading

Problem with a question

Playwright · Junior · question 34

Test yourself

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

Take this quiz