6.2.0

Released Released on December 20, 2020

Features:

  • You can now listen to before:run, after:run, before:spec and after:spec events in the plugins file when setting the experimentalRunEvents configuration option to true. See the before:run, after:run, before:spec and after:spec docs for more information. Addressed in #9646, #14178 #14238 and #14263.

  • The Timed out retrying error message now displays the amount of time Cypress retried. Addresses #5781.

  • The RouteMatcher argument for cy.intercept() has a new matchUrlAgainstPath property. When set to true, Cypress will match the supplied url against incoming paths. Addressed in #14241.

Bugfixes:

  • Passing a URL as a string or RegExp to cy.intercept() will automatically set matchUrlAgainstPath to true. This means that the supplied string or RegExp will be matched against the path if matching against the URL fails. Fixes #9379 and #14256.

  • Getting an alias of cy.intercept() using cy.get() will no longer always yield null. Fixes #9306.

  • cy.intercept() will now automatically responds to CORS preflight requests (HTTP OPTIONS requests) that match defined routes. Fixes #9599.

  • Response errors from forceNetworkError can now be awaited using cy.intercept() and cy.wait(). Fixes #9062.

  • Using cy.log() inside .then() no longer breaks the subject value in the command chain. Fixes #8084.

  • Using Cypress.Commands.overwrite to overwrite .then() now preserves the proper this context and sets aliases correctly. Fixes #5101.

  • Using Cypress.Commands.overwrite to overwrite cy.route() or cy.intercept() and wait on its alias now properly works. Fixes #3890 and #9580.

  • Cypress no longer fails to find specs if you set the fixtures folder to be the same as the integration folder. Fixes #14226.

  • Cypress no longer fails to show error code frames if the spec filename has a space in it, fixes #7553.

Misc:

  • scrollBehavior is now an allowed type when passed as test configuration. Addresses #9643.

  • The FileObject type for the file argument of the file:preprocessor event now includes the EventEmitter type. Addresses #9276.

Dependency Updates:

  • Upgraded electron from 11.0.2 to 11.0.3. Addressed in #9409.