Checking for child objects with Playwright

Viewed 20

I'm working on writing a test that will determine whether objects on the page are children of another object.

I know that I can use document.querySelector(selector).hasChildNodes(); to get a boolean whether the selector has children or not. However, (and this is likely because I'm new to Playwright) I cannot seem to find an equivalent method that works with the playwright test runner. For example,

const childTruth = page.querySelectory('.class').hasChildNodes();

Does not seem to allow .querySelectory to be used with page.

Is there any inbuilt methods that Playwright has to check for children of an object?

0 Answers
Related