Skip to content

overwrites baseUrl? #25

@davetron5000

Description

@davetron5000

Migrating something to use this gem—which I am so thankful exists—and for no good reason, my baseUrl was not /, so my initial cypress.json was like this:

{
  "baseUrl": "http://localhost:3000/foo"
}

bin/rails cypress:init did not change that value, but when I run bin/rails cypress:run, my guess is that the "use some random port to run the rails app" does this by setting baseUrl to http://localhost:«that random port», thus making my tests fail. They use cy.visit("/") and were requesting / and not /foo, which is what the baseUrl should've been sending them to (note the tests worked if I ran rails on its own and did cypress run).

I changed all my cy.visit("/") to cy.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 set baseUrl 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions