Use expect(locator).toHaveText() to ensure that the list has the text "apple", "banana" and "orange". Spent hours trying several different things, but without luck. 'hidden' - wait for element to be either detached from DOM, or have an empty bounding box or visibility:hidden. The method finds an element matching the specified selector in the ElementHandles subtree and passes it as a first argument to pageFunction. For example, it turns multiple spaces into one, turns line breaks into spaces and ignores leading and trailing whitespace. Note that many html elements like