openverse-frontend
openverse-frontend copied to clipboard
Use saved external network responses during Playwright tests
Problem
To make sure that the Playwright tests are not affected by different search results, we use recorded network responses or block some requests (i.e., the audio requests). Currently, we use talkback proxy to record and playback the API requests. However, the external requests for images from providers are not proxied, and use the network. This makes the tests slower and flakier.
Description
We need to find a way of proxying the network requests that are still going through in Playwright tests.
talkback allows us to only proxy one host, so it's not possible to use it as is.
Alternatives
We could also block provider URLs in Playwright tests, and alter the single image page to fallback on the thumbnail (which comes from our API, and is saved by talkback). This might be a stop-gap solution for now, but it's not as flexible.
Additional context
Implementation
- [ ] 🙋 I would be interested in implementing this feature.