-
Notifications
You must be signed in to change notification settings - Fork 49
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
overwrites baseUrl? #25
Comments
Sorry for the frustration, Dave! (👋 by the way) I spent a few minutes trying to make sense of the code, but I can't confirm or deny the root cause at first glance. This server#base_url method would seem to confirm your point, but it's not referenced anywhere in the gem, so maybe it's actually dead code 😱 Would happily accept any PR that would either improve the documentation or the gem for others |
Looks like this is where that happens: https://github.com/testdouble/cypress-rails/blob/master/lib/cypress-rails/launches_cypress.rb#L31 I guess I could've grep'ed that myself o_O I will make two PRs, one for docs and one for logging this. |
Fixed in 0.3.0 (see #26) |
Migrating something to use this gem—which I am so thankful exists—and for no good reason, my
baseUrl
was not/
, so my initialcypress.json
was like this:bin/rails cypress:init
did not change that value, but when I runbin/rails cypress:run
, my guess is that the "use some random port to run the rails app" does this by settingbaseUrl
tohttp://localhost:«that random port»
, thus making my tests fail. They usecy.visit("/")
and were requesting/
and not/foo
, which is what thebaseUrl
should've been sending them to (note the tests worked if I ran rails on its own and didcypress run
).I changed all my
cy.visit("/")
tocy.visit("/foo")
, and everything worked (and I should've done that anyway), but I guess what was surprising was that this gem means I cannot setbaseUrl
any longer. I think that is fine behavior, but maybe should be documented and/or output in some sort of log?If agreed, I can fork the README and write what would've made this not surprising to me, but wanted to confirm that behavior first.
The text was updated successfully, but these errors were encountered: