next.js
61432971 - Use new `browserWithResponse()` method in `empty-fallback-shells` tests (#80406)

Commit
200 days ago
Use new `browserWithResponse()` method in `empty-fallback-shells` tests (#80406) In e2e tests, we sometimes want to assert on the response headers and on the rendered HTML within the same test. For the former, we usually use `next.fetch()`, but this doesn't allow us to use the Playwright browser API to assert on the rendered HTML, which is available through `next.browser()`. This is especially tricky when a PPR shell is resumed, where asserting on the response text is error-prone, as the streamed-in HTML may change the elements that we want to assert on. To avoid the maintenance and runtime overhead of splitting the test into two separate tests, we introduce a new `next.browserWithResponse()` method that allows us to use the Playwright browser API while also exposing the response to check the headers and other properties. --------- Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
Author
Parents
Loading