Playwright · Middle · Question 49 of 75

Which assertion checks the texts of a whole list in order?

Show the answer

Correct answer: await expect(items).toHaveText(['A', 'B', 'C'])

Explanation

Passing an array to toHaveText matches each element in order and checks the count.

Further reading

Problem with a question

Playwright · Middle · question 49

Test yourself

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

Take this quiz