Page MenuHomeSoftware Heritage

cypress: Migrate from cy.route API to cy.intercept API
ClosedPublic

Authored by anlambert on Mar 9 2021, 5:00 PM.

Details

Summary

cy.route has been deprecated in cypress 6.0 in favor of cy.intercept
and will be removed soon.

So migrate code stubbing network requests to the intercept API.

The only drawback of the intercept API is that currently stubbed responses
can not be overridden but hopefully a simple workaround can be used.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5222 (id=18707)

Rebasing onto 63d44b561a...

Current branch diff-target is up to date.
Changes applied before test
commit aeefa9ac974c2be915b6777d6a1c14183abfe840
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Mar 9 16:56:21 2021 +0100

    cypress: Migrate from cy.route API to cy.intercept API
    
    cy.route has been deprecated in cypress 6.0 in favor of cy.intercept
    and will be removed soon.
    
    So migrate code stubbing network requests to the intercept API.
    
    The only drawback of the intercept API is that currently stubbed responses
    can not be overridden but hopefully a simple workaround can be used.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/617/ for more details.

This revision is now accepted and ready to land.Mar 9 2021, 5:18 PM

Use Object.keys instead of Cypress._.keys.

Build is green

Patch application report for D5222 (id=18708)

Rebasing onto 63d44b561a...

Current branch diff-target is up to date.
Changes applied before test
commit 83ecdb860d6029ced77f23f942cde24b361bf0d4
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Tue Mar 9 16:56:21 2021 +0100

    cypress: Migrate from cy.route API to cy.intercept API
    
    cy.route has been deprecated in cypress 6.0 in favor of cy.intercept
    and will be removed soon.
    
    So migrate code stubbing network requests to the intercept API.
    
    The only drawback of the intercept API is that currently stubbed responses
    can not be overridden but hopefully a simple workaround can be used
    (see https://github.com/cypress-io/cypress/issues/9302).

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/618/ for more details.