cypress web-app in vagrant, web-browser in host
See original GitHub issuehow can we use the cypress web-app ./node_modules/.bin/cypress open --port 4567
in a web-browser on vm host?
we develop our web-shop in a headless linux virtual machine (vagrant) on a ms-windows host, and when i try to open the cypress web-app in google-chrome on host i get an error: “This browser was not launched through Cypress. Tests cannot run.”
if not possible, what is the technical limitation?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to run Cypress test runner in vagrant guest using host ...
1. You need an X-Server on the host. · 2. Enable X-forwarding on your Vagrant VM · 3. Ssh into the box without...
Read more >Launching Browsers | Cypress Documentation
When you run tests in Cypress, we launch a browser for you. This enables us to: Create a clean, pristine testing environment. Access...
Read more >How to Use MailHog to Test Emails Locally (Step-by ... - Kinsta
It's a real pain to know whether your website's or web app's outgoing emails are actually reaching the recipient's inbox. Enter, MailHog!
Read more >How to Run Cypress Tests in Chrome and Edge | BrowserStack
This article will demonstrate how to use Cypress browser website test cases on Google Chrome and Microsoft Edge with examples.
Read more >Example: Web Test Tools - SoftwareQATest.com
K6 - Cloud-based online load testing tool for Web app and API ... your virtual device in a web browser (no plugin needed):...
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
I figured out what to do, just in case you are still interested @hlb-schmidt or anyone else in the future: Assuming you have correctly installed cypress and can run it headless:
yarn run cypress run
(or whichever way you run it,npm
etc)1. You need an X-Server on the host.
2. Enable X-forwarding on your Vagrant VM
Just add this to your
Vagrantfile
config.ssh.forward_x11 = true
3. Ssh into the box without vagrant ssh We need to access the guest with
ssh
as opposed to the normalvagrant ssh
. Do do this: run$ vagrant ssh-config
on the host in your directory with the vagrant fileFrom this we have the details we need to ssh. The
user
, theHostName
thePort
and theIdentityFile
.Now we can, from the host
ssh
into the guest and run the cypress test runner.We also need to add
-X
flag that tellsssh
to use the X-forwarding.Assuming my project runs in a directory called
project
in the home directory of my guest machine… Run this command from the host machine while your box in running.ssh vagrant@127.0.0.1 -X -p 2222 -i /Users/xxxx/work/.vagrant/private_key -t "cd /home/vagrant/project; yarn run cypress open"
Voila! the Test runner will run in your box and the GUI will display on your host machine.
Credits to Gabor and Martin
hmm, Thanks for the feedback @hlb-schmidt . I do appreciate, Checking out PlayWright now. The marketing team, I believe, will eventually catch up with the right technology once they see the need to be more productive!