Playwright · Middle · Question 49 of 75
Which assertion checks the texts of a whole list in order?
- 1
await expect(items).toContainList(['A', 'B', 'C']) - 2
await expect(items).toEqual(['A', 'B', 'C']) - 3
await expect(items).toHaveText(['A', 'B', 'C'])
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.