Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control for when and if cy.route() responds #14

Closed
jennifer-shehane opened this issue Apr 6, 2015 · 1 comment
Closed

Control for when and if cy.route() responds #14

jennifer-shehane opened this issue Apr 6, 2015 · 1 comment
Labels
type: feature New feature that does not currently exist

Comments

@jennifer-shehane
Copy link
Member

I want to be able to control when and if a route responds. My biggest use case is testing loading logic in my app. Currently, if I write the example below, Cypress will auto respond to the image route (with a 404) before my assertion.

it "displays loading gif on image load", ->
  cy.route
    url: /image/
    response: {http://cdn.morguefile.com/imageData/public/files/g/g3c59w/03/l/1427371209n1lyb.jpg}

  cy.get("a").click()
  cy.get("img").should("have.attr", "src").to("match", /ajax.gif/)

Some suggestions:

  • Allow for option of autoRespond: false to be passed into cy.route()
  • Have a way to tell the route to respond at a later point in the test.
  • Allow for a specific delay time before auto responding (allow this is probably a separate issue)
@jennifer-shehane jennifer-shehane added the type: feature New feature that does not currently exist label Apr 6, 2015
@brian-mann
Copy link
Member

Fixed in 0.5.10.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests

2 participants