Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Improve the "Intercept HTTP Requests" guide and related articles #6339

Open
dxVito opened this issue Jun 25, 2021 · 0 comments
Open
Labels
AREA: docs An issue related to the product documentation. TYPE: enhancement The accepted proposal for future implementation.

Comments

@dxVito
Copy link

dxVito commented Jun 25, 2021

  • 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:

https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/mocking-http-requests.html#mocking-cross-domain-requests

  • Move the "Select Requests to be Handled by the Hook" info to the root of the "Intercept HTTP Requests" guide:

https://testcafe.io/documentation/402763/reference/test-api/requestmock/onrequestto#select-requests-to-be-handled-by-the-hook

  • 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

@dxVito dxVito added TYPE: enhancement The accepted proposal for future implementation. AREA: docs An issue related to the product documentation. labels Jun 25, 2021
@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Jun 25, 2021
@miherlosev miherlosev removed the STATE: Need response An issue that requires a response or attention from the team. label Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AREA: docs An issue related to the product documentation. TYPE: enhancement The accepted proposal for future implementation.
Projects
None yet
Development

No branches or pull requests

2 participants