Cypress will fail wit urls with a domain in the form of "*.local*"
See original GitHub issueIf you try to run Cypress having set up the baseUrl as something like something.localhost
or something.localsite
it will not run and instead it will bring up a browser screen with a grey background, no command log window
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Web Security - Cypress Documentation
Injects document.domain into text/html pages. Proxies all HTTP / HTTPS traffic. Changes the hosted URL to match that of the application under test....
Read more >visit - Cypress Documentation
Cypress will prefix the URL with the baseUrl configured in your global configuration if set. ... You cannot visit different super domains in...
Read more >Best Practices - Cypress Documentation
This way, if it is changed, the test will fail. If the answer is no because the text could be changed - then...
Read more >Error Messages | Cypress Documentation
This error only pertains to Cypress version v11.0.0 and under. As of Cypress v12.0.0, users can navigate to multiple domains in a single...
Read more >Cypress 9.6.0: Easily test multi-domain workflows with cy.origin
Today we're proud to introduce a feature a lot of Cypress users have been asking for: testing multiple superdomains in a single test!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in
1.4.2
.By default any domain with the pattern
*.localhost
points to127.0.0.1
. This is becauselocalhost
is a loopback address, and DNS implementations have defined this behavior by default.In my experience, this behavior is respected in Firefox and Chrome, and also in Windows and Ubuntu.
Sadly when running tests with Cypress this behavior is not respected. I don’t have the gray screen as other users in this issue, but my tests fail because host cannot be reached (everything works well when using the browser without Cypress).
As a workaround I had to add manually
127.0.0.1 project.localhost
to my/etc/hosts
file. This fixes the issue, but misses completely the purpose of using a.localhost
domain, it’s very annoying to add all your domains one by one when you have many services (typically when using a reverse proxy like Traefik).It would be great if you can fix this, thanks in advance 😃