import { ElementHandle } from 'playwright' ; export async function querySelectorAllFromHandles ( selector , rootElements ) { const result = [ ] ; for ( let index = 0 ; index < rootElements . length ; index ++ ) { const rootElement = rootElements [ index ] ; const foundElements = await rootElement . $$ ( selector ) ; result . push ( ... foundElements ) ; } return result ; }