This thread is trying to answer question "Is there any way to compare prices coming from the backend in Playwright?"
You can use locator.evaluate
to get the text. Something like this:
expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
https://playwright.dev/docs/next/api/class-locator#locator-evaluate
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].