When you click a button, a background request starts. If you assert the UI before the response arrives, the test becomes unreliable. The waitForResponse call solves this problem: it waits for the matching HTTP response.
Usage: call await page.waitForResponse('/api/submit') first, then click the button. A URL glob ('**/api/submit') also works.
page is available. Wait for the /api/submit response before clicking the Send button.