-
Notifications
You must be signed in to change notification settings - Fork 677
Description
-
Rewrite the intro part and describe in more detail the purpose of Request Hooks, specify in which cases a certain Request Hook can be useful (e.g. "RequestLogger stores all sent HTTP requests and received responses just like the "Network" tab in a browser's DevTools" or "use RequestMock to mock analytics calls").
-
Return the "Mocking cross-domain requests" section, which seems to be lost in the latest documentation update:
- Move the "Select Requests to be Handled by the Hook" info to the root of the "Intercept HTTP Requests" guide:
- Expand the "Select Requests to be Handled by the Hook" section with real-world examples. Look at these questions:
https://stackoverflow.com/questions/59454749/testcafe-multiple-requests-to-endpoint-synchronously-not-working
https://stackoverflow.com/questions/62219146/change-testcafe-requestmock-api-response-based-on-request-body
https://stackoverflow.com/questions/65906496/testcafe-mock-backend-data-being-overridden
https://stackoverflow.com/questions/65717087/how-to-mock-the-same-request-of-different-origins-urls-for-testcafe
https://stackoverflow.com/questions/59083652/can-we-have-more-than-one-key-value-for-method-in-requestlogger-for-testcafe
- RequestMock - Add an example to illustrate how to deal with dynamic URL parameters based on these questions:
https://stackoverflow.com/questions/57002221/mock-api-to-give-response-based-on-request-urls-dynamic-part
https://stackoverflow.com/questions/59754362/regular-expression-for-matching-dynamic-part-in-url-while-mocking-api-is-not-wor
https://stackoverflow.com/questions/62382355/how-to-pass-query-params-of-a-request-url-while-mocking-with-request-hooks-in-te
https://stackoverflow.com/questions/62968747/create-requestmock-with-dynamic-url-params-testcafe
- RequestLogger - Describe how to wait for a response based on these questions:
https://stackoverflow.com/questions/58934222/requestlogger-waiting-for-requests0-response
https://stackoverflow.com/questions/62798820/testcafe-requestlogger-how-to-wait-for-all-responses-to-return-before-doing-an
https://stackoverflow.com/questions/63702464/testcafe-typeerror-cannot-read-property-response-of-undefined
https://stackoverflow.com/questions/54677238/testcafe-requestlogger-not-intercepting-api-calls
- Add a note that RequestLogger doesn't support the async function for the predicate parameter of the contains function based on this question:
https://stackoverflow.com/questions/56933029/testcafe-checking-api-response-always-passes