From 0a9e9bbebb3cdd90fdaf3039ca230f281140a090 Mon Sep 17 00:00:00 2001 From: zernie Date: Fri, 23 Aug 2024 16:21:00 +0300 Subject: [PATCH] Update README.md Add info concerning static assets interception --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 26de4c4..09b33a5 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,13 @@ cy.playback('POST', \/users\/); // Providing playback options. cy.playback('GET', \/todos\/, { toBeCalledAtLeast: 2 }); // Aliasing the request for later use in the test. + // In case of static assets, it is best to clear the browser cache to ensure proper interception: +cy.wrap( + Cypress.automation('remote:debugger:protocol', { + command: 'Network.clearBrowserCache' + }) +) + cy.playback('GET', 'https://www.example.com/300/150').as('image'); ```