Closed
Description
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:
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:
cy.route2('/timeout', {
statusCode: 200,
body: payload,
delayMs,
throttle: '3g',
})
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
Activity
cypress-bot commentedon Sep 11, 2020
The code for this is done in cypress-io/cypress#8109, but has yet to be released.
We'll update this issue and reference the changelog when it's released.
cypress-bot commentedon Sep 15, 2020
Released in
5.2.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v5.2.0, please open a new issue.
1 remaining item