-
Notifications
You must be signed in to change notification settings - Fork 681
Open
Labels
TYPE: bugThe described behavior is considered as wrong (bug).The described behavior is considered as wrong (bug).
Description
What is your Scenario?
I want to change request url path by RequestHook. I need to add extra query param.
What is the Current behavior?
When I set event.requestOptions.path
in RequestHook with the new value, I still see the old url in the browser network.
What is the Expected behavior?
In browser network I'd like to see updated request url
What is your TestCafe test code?
// custom hook
class ExtraParamHook extends RequestHook {
async onRequest(event) {
const url = new URL(event.requestOptions.url);
if (url.pathname.includes('/drm/')) {
url.searchParams.set('test', Date.now().toString());
event.requestOptions.path = `${url.pathname}${url.search}`;
}
}
onResponse() { /* empty */ }
}
const addExtraParams = new ExtraParamHook();
// in fixture:
fixture`...`
.page(...)
.requestHooks(addExtraParams)
TestCafe version
3.7.0
Metadata
Metadata
Assignees
Labels
TYPE: bugThe described behavior is considered as wrong (bug).The described behavior is considered as wrong (bug).