Have a way to visit a local HTML file without prepending the `baseUrl`
See original GitHub issueCurrent behavior:
If I want to open a local file for test, like:
cy.visit('file:///Users/jasonzhang/Desktop/test.html')
I got an error:
CypressError: cy.visit() failed trying to load: file:///Users/jasonzhang/Desktop/test.html We attempted to make an http request to this URL but the request failed without a response. We received this error at the network level:
Error: Invalid URI “file:///Users/jasonzhang/Desktop/test.html” Common situations why this would fail:
- you don’t have internet access
- you forgot to run / boot your web server
- your web server isn’t accessible
- you have weird network configuration settings on your computer
Desired behavior:
Support it.
Versions
3.3.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
How to visit a page that is on my computer with Cypress
Learn how to test an HTML page that is only in your local environment ; Today's “Pinch of cypress” is inspired by a...
Read more >visit - Cypress Documentation
Visit local file when baseUrl is set. If you have baseUrl set, but need to visit a local file in a single test...
Read more >How to load a local html file in a xamarin forms webview
To display local content using a WebView, you'll need to open the HTML file ... any links to local resources in your HTML...
Read more >The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >HTML and URLs
Every resource available on the Web --- HTML document, image, video clip, program, etc. --- has an address that may be encoded by...
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
You can visit a file by specifying the relative path to
cy.visit()
- relative to the projectRoot.When I run cy.visit(‘./cypress/screenshots/screenshot.html’) the baseurl is being added and I am not on file:// https://fleetlocate-stage.spireon.com/./cypress/screenshots/screenshot.html
I was expecting file://./cypress/screenshots/screenshot.html
Using cypress 3.6.0