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

404 on https://qa.myapp.com/__cypress__/command #25

Closed
gaboma19 opened this issue Jul 9, 2019 · 6 comments
Closed

404 on https://qa.myapp.com/__cypress__/command #25

gaboma19 opened this issue Jul 9, 2019 · 6 comments
Assignees
Labels

Comments

@gaboma19
Copy link

gaboma19 commented Jul 9, 2019

Has anyone else encountered getting a 404 on the gem's endpoint? The gem is installed and setup and everything... I'd appreciate some tips to debug this.

It works on my machine but not in my app's QA environment.

CypressError: cy.request() failed on:

https://qa.myapp.com/__cypress__/command

The response we received from your web server was:

  > 404: Not Found

This was considered a failure because the status code was not '2xx' or '3xx'.

If you do not want status codes to cause failures pass the option: 'failOnStatusCode: false'
@grantspeelman
Copy link
Collaborator

@gaboma19 Are you trying to run cypress against a Rails app running in production mode?
The default is only load cypress-on-rails when running in test mode due possible security implications when having the gem and middleware available on a production app.

You could use cypress without the cypress-on-rails commands (EG cy.app, cy.appFactories )
OR
You can move cypress-on-rails gem out of development and test groups and enable the middleware in config/initializers/cypress_on_rails.rb and set c.use_middleware = true

Let me know if any of this helps.

@grantspeelman grantspeelman self-assigned this Jul 11, 2019
@grantspeelman
Copy link
Collaborator

Closing issue due to no response

@stoplion
Copy link

Same issue, is this route suppose to be there by default?
RAILS_ENV=test rake routes | grep cypress
No command route.

@grantspeelman
Copy link
Collaborator

it is not a route, it's middleware

@grantspeelman
Copy link
Collaborator

Make sure to check you cypress_on_rails.rb initializer and make sure use_middleware is enabled for your environment.

@sonianand11
Copy link

I have faced the same issue, in config/initializer/cypress_on_rails.rb my cypress directory path was wrong and I was running rails server in development env. So rails s -e test fixes the issue.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants