The Playwright documentation explains that a comma-separated list of CSS selectors will match all elements that can be selected by one of the selectors in that list. However, when I try to implement this, it doesn't seem to work as expected.
For example, if I use the following code:
await expect(page.locator('text="Banana"')).toBeVisible();
it successfully matches the element. But when I try this code:
await expect(page.locator('text="Banana", text="foo"')).toBeVisible();
the test hangs indefinitely.
I am left wondering, is the comma-separated list not considered a valid "CSS selector"? How can I accomplish the same functionality properly?