Could someone please help me with passing fixture alias to intercept method in Cypress v 9.0. I remember using the following syntax in Cypress ~4 with route method as
cy.route("GET", "**/users/*", "@users")
where @users is a fixture defined as cy.fixture('users.json').as('users')
Since the cy.route is deprecated and we switched to using cy.intercept, I cannot seem to find the right syntax for passing fixture alias to the intercept method. I would like to know if the following syntax is possible cy.intercept("GET", "**/users/*", "@users")
Any help is kindly appreciated. Thanks
I don't think there's a configuration to use an aliased fixture with intercept.
You can however, use the fixture name explicitly
Given the fixture is now named in the
staticResponse
object, you may be able to use the alias there (but I don't see it documented)If you have a specific need to use an aliased value, this pattern is equivalent