Add throttleKbps, delayMs with presets to StaticResponse objects #7661
Labels
pkg/driver
This is due to an issue in the packages/driver directory
topic: cy.intercept()
type: enhancement
Requested enhancement of existing feature
Current behavior:
Users have to invoke
.delay()
or.throttle()
to delay/throttle the response, and they have to use plain numbers (ms and kbps, respectively) to set the throttle:cypress/packages/driver/test/cypress/integration/commands/net_stubbing_spec.ts
Lines 766 to 774 in 2443eb4
Desired behavior:
Users should be able to statically define throttleKbps or delayMs, and should be able to use string presets. So the above code could be written as this:
For the list of throttle presets, we can probably use the same list that Chromium/WebKit use: https://source.chromium.org/chromium/chromium/src/+/master:chrome/test/chromedriver/chrome/network_list.cc;l=12;drc=23bc3b1c92fd920d4d359ba46d73054ff0f47d2c?originalUrl=https:%2F%2Fcs.chromium.org%2F
Depends on #687
The text was updated successfully, but these errors were encountered: