I'm migrating my tests from cypress to playwright. I have a content on a page that is used in different ways but contains the same elements. I could handle this situation very easily using "within" in Cypress. How can I do this in Playwright?
I am looking for another way than page.locator('selector').locator('locator2')
I am trying to find a way like below.
page1
.pageItem()
.within(() => {
itemValidation.validateData();
});