In Cypress, cy.intercept
can be used for this purpose:
cy.intercept('GET', 'https://hello.com/script.js').as('scriptLoaded');
cy.wait('@scriptLoaded', {timeout: 20000});
How do I do that in Playwright?
Think what You are looking for are wait for request and/or response : https://playwright.dev/docs/api/class-page#page-wait-for-request