Can't Wait for Windows: Cypress
Published: 2017-08-23 02:31:37

---
title: "Can't Wait for Windows: Cypress"
published: true
description: 
tags: 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/q4rbafop75xmmcetw41o.png
---

When I first saw Cypress a couple years ago, I watched a demo video from the creator and nearly cried tears of joy. I signed up for early access, but never got accepted. I bothered them in their team chat once. I clicked the Watch button on the [github project](https://github.com/cypress-io/cypress) and waited - with an eye on this particular issue: [Windows support?](https://github.com/cypress-io/cypress/issues/74)

Some are still waiting on Windows support, but I can't wait any longer. Luckily there is a breadcrumb in the github issue: When someone attempts to run Cypress on Windows the error message is supposed to show: <code>You can use Cypress if you install a Linux VM using something like VirtualBox.</code>

#VirtualBox

Never heard of it. My virtual machines have always been VMWare. [Googled.](https://www.google.com/search?q=virtualbox) [Downloaded.](https://www.virtualbox.org/wiki/Downloads) Installed.

Pretty straightforward. There's a dropdown to choose my operating system. My last experience with Linux was back in 2009 when Windows Vista was out and everyone hated it and Ubuntu was the Linux messiah. I tried it out at the time, only to remember there's no Visual Studio for Ubuntu and abandoned any further effort to switch. Ubuntu is in the VirtualBox list of OSes, and I selected it.

#Ubuntu

... <code>FATAL: Could not read from the boot medium.</code>

You mean I have to install Ubuntu myself? Weak. Why the dropdown? Whatever. [Googled.](https://www.google.com/search?q=ubuntu+download) [Downloaded.](https://www.ubuntu.com/download/desktop) Mounted.

... <code>This kernel requires an x86-64 CPU, but only detects an i686 CPU, unable to boot.</code>

I don't know what you're detecting but it isn't an i686. [Googled.](https://askubuntu.com/questions/308937/cannot-install-ubuntu-in-virtualbox-due-to-this-kernel-requires-an-x86-64-cpu) Oh I have to create a new VM and choose the 64-bit Ubuntu from the dropdown... There's no 64-bit option. [Googled.](http://www.fixedbyvonnie.com/2014/11/virtualbox-showing-32-bit-guest-versions-64-bit-host-os/#.WZzSMem2z6Q) Oh, I need to change my BIOS settings to enable "Virtualization Technology", fine.

Installed Ubuntu. Alright, now we're talking! What's all this Office software? Is this why the ISO took forever to download? Get rid of that desktop trash real quick. Now time to follow the [Cypress installation guide.](https://docs.cypress.io/guides/getting-started/installing-cypress.html)

I need node installed. [Googled.](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04) <code>sudo apt-get update</code>

Oh, no, no internet. [Googled.](https://supportforums.cisco.com/t5/vpn/anyconnect-3-1-04072-won-t-allow-internet-connectivity-from/td-p/2400378) I have to change Ubuntu settings to work with the host's Cisco AnyConnect VPN. <code>VBoxManage modifyvm "Cypress.io" --natdnshostresolver1 on</code> Baffles me that it has to be run on the virtual machine and not the physical machine, or in VirtualBox Manager. Again, whatever. Let's go.

#Node and NPM

<code>sudo apt-get update</code>
<code>sudo apt-get install nodejs</code>

And although it's not mentioned in the Cypress docs, they use the npm command and I know that's separate - not that I've ever used it, must have learned that by osmosis.

<code>sudo apt-get install npm</code>

Fantastic. Let's get the cypress-cli.

<del><code>npm install -g cypress-cli</code></del>

Error. Can't connect. I can browse the internet otherwise... does it work on my physical machine? Oh, no, registry.npmjs.org is blocked by the corporate proxy under the category "internet-communications". First off, that category doesn't make sense, and second, I take offense to npm being blocked. That's like telling hundreds of thousands of people their collective work isn't to be trusted. File a support ticket with NetSec... unblocked.

<del><code>npm install -g cypress-cli</code></del>

Nope. That didn't work. Need to install nodejs-legacy.

<code>sudo apt-get install nodejs-legacy</code>
<code>npm install -g cypress-cli</code>
<del><code>cypress install</code></del>

Didn't work. Need git.

<code>sudo apt-get install git</code>
<code>cypress install</code>
<code>cypress open</code>

Hooray. I can log in with GitHub? Cool, I have one of those. Installing Cypress docs covered, now on to [Writing Your First Test](https://docs.cypress.io/guides/getting-started/writing-your-first-test.html)... "Open up your favorite IDE". Ouch, 2009 coming back to punch me in the face. At some point I'll be checking this into source control, so better make sure I have something that supports TFS. [Googled.](http://blogs.microsoft.co.il/morgen/2010/06/07/using-tfs-in-linux-ubuntu/) Thank you blog from 2010 for your solution to my 2009 problem.

#Eclipse

[Googled.](http://ubuntuhandbook.org/index.php/2016/01/how-to-install-the-latest-eclipse-in-ubuntu-16-04-15-10/) Looks like I need Java 8 first. One step forward, two steps back.

<code>sudo add-apt-repository ppa:webupd8team/java</code>
<code>sudo apt-get update</code>
<code>sudo apt-get install oracle-java8-installer</code>

Got that. [Download Eclipse.](https://www.eclipse.org/downloads/) Extract. Double click an icon to install - that would be nice if it were Windows but at this point I'm expecting to use the command line.

Team Explorer Everywhere... [Googled.](https://msdn.microsoft.com/en-us/library/hh301122(v=vs.120).aspx) I read that there is also a plugin for IntelliJ, and I have read that many people prefer IntelliJ over Eclipse. Too late for that now, I want my automated testing.

Download Source... 

#Cypress

Add folder... New Cypress project... Copy/paste/gut example test file. Within a half hour I had a test to log in to a site using OAuth:

      describe('Log On Test', function() {
        it('Logs On www.mysite.com', function() {
          cy.visit('https://www.mysite.com')
          cy.get('.landing-login-panel .mdl-card__supporting-text:last a').contains('Log In').click()
          if (cy.url('host') === 'login.domain.com') {
            cy.get('#domain-id').type('username')
            cy.get('#password').type('********')
            cy.get('.submit').click()
          }

          cy.wait(2000)
          cy.get('.user-nav-menu').click()
          cy.get('[for="UIMenu-99"]').should('be.visible')
          cy.get('[for="UIMenu-99"] a[href="/MyProfile"]').click()
        })
      })

#Satisfaction

Plowing ahead without letting obstacles get in your way. That's a skill I has. It certainly was an odyssey to set this up, but it was a morning well spent.

Maybe once I recreate the regression test suite I'll work on integrating it into the CI workflow. I'm sure QA and devops will love that.

And one day, Windows Support will come to Cypress, and I'll force it upon my co-workers.