Skip to content

cy.route2() doesn't work when method is used as the first parameter #8729

@bhgsbatista

Description

@bhgsbatista

Current behavior

When passing POST as the first parameter to route2 requests are not properly intercepted.

// Does not work
cy.route2('POST', `${BasePage.api_url}/events/createTemplate`).as('create_template')
cy.wait('@create_template')

// Works
cy.route2(`${BasePage.api_url}/events/createTemplate`).as('create_template')
cy.wait('@create_template')

Desired behavior

Using the method parameter should work.

Test code to reproduce

https://github.com/bhgsbatista/cypress-test-tiny/tree/route2_method_fail

Versions

Cypress v5.3.0
Windows 10

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions