{"_id":"5697efe61c4dc8230054268d","category":{"_id":"56954a95fe18811700c9bfdc","version":"56954a94fe18811700c9bfda","__v":4,"pages":["56954a97fe18811700c9c01c","5697efe61c4dc8230054268d","56980d8b3503e40d0061f4fa","569813082cf4060d004eaac3"],"project":"568fde81b700ce0d002f4b43","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-08T17:24:53.954Z","from_sync":false,"order":1,"slug":"getting-started","title":"Getting Started"},"version":{"_id":"56954a94fe18811700c9bfda","project":"568fde81b700ce0d002f4b43","__v":6,"createdAt":"2016-01-12T18:48:52.007Z","releaseDate":"2016-01-12T18:48:52.007Z","categories":["56954a95fe18811700c9bfdb","56954a95fe18811700c9bfdc","56954a95fe18811700c9bfdd","56954a95fe18811700c9bfde","56954a95fe18811700c9bfdf","56954a95fe18811700c9bfe0","56954a95fe18811700c9bfe1","56954a95fe18811700c9bfe2","56954a95fe18811700c9bfe3","56954a95fe18811700c9bfe4","5695649fdcaf0d1700cb8721","5696c1168560a60d00e2c1d6","56a7a32e79395317007c1ad6","5898fc3eec49fb0f004c2663","589cc675ea37da23004e05e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"foo","version_clean":"0.0.0","version":"0.0"},"project":"568fde81b700ce0d002f4b43","parentDoc":null,"user":"568fffce769f210d0013258f","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-14T18:58:46.203Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"# Contents\n\n- :fa-angle-right: [System Requirements](#section-system-requirements)\n- :fa-angle-right: [Installing](#section-installing)\n  - [Command Line](#section-command-line-tool)\n  - [Direct Download](#section-direct-download)\n- :fa-angle-right: [Logging In](#section-logging-in)\n- :fa-angle-right: [Adding Projects](#section-adding-projects)\n- :fa-angle-right: [Running Headlessly](#section-running-headlessly)\n\n***\n\n# System Requirements\n\nCypress is a desktop application. This desktop application is the equivalent replacement of Selenium Server and must be running to test in Cypress.\n\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The desktop application manages your local projects. The actual testing will be done in a **browser**, not the desktop application\"\n}\n[/block]\n\nThe desktop application can be installed in the following operating systems:\n\n| Operating System |\n| ------ |\n| Linux |\n| OSX |\n\nWindows is [(not yet working)](https://github.com/cypress-io/cypress/issues/74).\n\nThere are no dependencies to install the Desktop Application, although if you want to [use Cypress from the Command Line](https://github.com/cypress-io/cypress-cli) you will need to have `node` installed.\n\n***\n\n# Installing\n\nYou can install Cypress in 2 different ways:\n* [Cypress CLI Tool](https://github.com/cypress-io/cypress-cli)\n* [Direct Download](#section-direct-download)\n\n## Command Line Tool\n\n[block:code]\n{\n    \"codes\": [\n        {\n            \"code\": \"## install the Cypress CLI tool\\nnpm install -g cypress-cli\\n\\n## install the Desktop Cypress app\\ncypress install\\n\",\n            \"language\": \"shell\"\n        }\n    ]\n}\n[/block]\n\n![cypress-cli](https://cloud.githubusercontent.com/assets/1268976/14435124/4f632278-ffe4-11e5-9dab-0a2d493551b3.gif)\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The Cypress CLI Tool contains many additional options such as installing a specific Cypress version.\\n\\nSee the [Cypress CLI Docs](https://github.com/cypress-io/cypress-cli#installation).\",\n  \"title\": \"Cypress CLI\"\n}\n[/block]\n\n## Direct Download\n\nYou can download Cypress directly [here.](http://download.cypress.io/desktop)\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"The vast majority of the time, Cypress will install correctly. But if you're on Linux you [might have to install some other dependencies](https://on.cypress.io/guides/continuous-integration#section-dependencies).\",\n  \"title\": \"Woops, I got an error installing\"\n}\n[/block]\n\n***\n\n# Logging In\n\nAfter installing, you will need to login to Cypress. Login currently requires a [Github](https://github.com/) account, if you do not have an account, you will have to [create one](https://github.com/join) to use Cypress.\n\n**To Login:**\n\n- Open the Cypress App -- just double click the app from your OS applications folder.\n- Click \"Log In with GitHub\".\n- Authorize GitHub access to your account.\n\n![Log In to Cypress](https://cloud.githubusercontent.com/assets/1271364/18134962/38a6c3d8-6f6e-11e6-998b-9884496cb898.png)\n\n## Your email: `jane.doe:::at:::gmail.com` has not been authorized.\n\nWhile in beta, the Cypress team has to whitelist the email address associated with your GitHub account in order for you to use Cypress.\n\n- If you received this error and have never filled out our [Early Adopter Access](http://goo.gl/forms/4vEMwj8LNT) form, fill out this form with the email in the error so we can whitelist it. You will receive an invite during one of our future Beta invites.\n- If you received this error after receiving a Beta invite email from Cypress, please send an email to [email protected]** telling us the email in the error so we can whitelist it.\n\n***\n\n# Adding Projects\n\nAfter successfully logging in, you will need to add the project(s) you want to write Cypress tests in.\n\n- Click :fa-plus: Add Project.\n\n![Add Project in LeftHand Corner](https://cloud.githubusercontent.com/assets/1271364/22699969/fe44c2e4-ed26-11e6-83d0-9baa0f51b15e.png)\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Projects added in our Desktop Application are strictly local to your computer. They are not tracked in any way by Cypress servers and do not communicate with us until they are [setup to be recorded](https://on.cypress.io/guides/projects#section-recording-runs).\"\n}\n[/block]\n\n***\n\n# Running Tests from the GUI\n\nTo run tests:\n\n- Click on the project.\n- You will then come to a page listing all files in your project's `cypress/integration` folder. If it's a new project, you'll see a message about the folder structure generated for you and also an `example_spec.js` file.\n- Click on the test file you want to run or click \"Run All Tests\".\n- After opening your project in Cypress, Cypress will generate a `cypress.json` file in your project:\n\n[block:code]\n{\n    \"codes\": [\n        {\n            \"code\": \"<your project>/cypress.json\\n\",\n            \"language\": \"text\"\n        }\n    ]\n}\n[/block]\n\nThis file contains a unique `projectId` and allows for specific Cypress [configuration](https://on.cypress.io/guides/configuration). It is okay to commit this file to `git`.\n\n***\n\n# Running Headlessly\n\nWhile you'll find yourself working primarily in the GUI, it is helpful to be able to run your tests headlessly.\n\nOnce you have the [Cypress CLI Tool](https://github.com/cypress-io/cypress-cli) installed, you can simply execute:\n\n[block:code]\n{\n    \"codes\": [\n        {\n            \"code\": \"cypress run\\n\",\n            \"language\": \"shell\"\n        }\n    ]\n}\n[/block]\n\nAdditionally you can specify:\n\n- a single test file\n- [a specific reporter and reporter options](https://on.cypress.io/guides/reporters)\n- a different port\n- environment variables\n\nYou can [read about all of these options](https://github.com/cypress-io/cypress-cli#cypress-run-1) which are documented on the Cypress CLI tool.","excerpt":"Quick start guide for using Cypress","slug":"installing-and-running","type":"basic","title":"Installing and Running"}

Installing and Running

Quick start guide for using Cypress

# Contents - :fa-angle-right: [System Requirements](#section-system-requirements) - :fa-angle-right: [Installing](#section-installing) - [Command Line](#section-command-line-tool) - [Direct Download](#section-direct-download) - :fa-angle-right: [Logging In](#section-logging-in) - :fa-angle-right: [Adding Projects](#section-adding-projects) - :fa-angle-right: [Running Headlessly](#section-running-headlessly) *** # System Requirements Cypress is a desktop application. This desktop application is the equivalent replacement of Selenium Server and must be running to test in Cypress. [block:callout] { "type": "info", "body": "The desktop application manages your local projects. The actual testing will be done in a **browser**, not the desktop application" } [/block] The desktop application can be installed in the following operating systems: | Operating System | | ------ | | Linux | | OSX | Windows is [(not yet working)](https://github.com/cypress-io/cypress/issues/74). There are no dependencies to install the Desktop Application, although if you want to [use Cypress from the Command Line](https://github.com/cypress-io/cypress-cli) you will need to have `node` installed. *** # Installing You can install Cypress in 2 different ways: * [Cypress CLI Tool](https://github.com/cypress-io/cypress-cli) * [Direct Download](#section-direct-download) ## Command Line Tool [block:code] { "codes": [ { "code": "## install the Cypress CLI tool\nnpm install -g cypress-cli\n\n## install the Desktop Cypress app\ncypress install\n", "language": "shell" } ] } [/block] ![cypress-cli](https://cloud.githubusercontent.com/assets/1268976/14435124/4f632278-ffe4-11e5-9dab-0a2d493551b3.gif) [block:callout] { "type": "info", "body": "The Cypress CLI Tool contains many additional options such as installing a specific Cypress version.\n\nSee the [Cypress CLI Docs](https://github.com/cypress-io/cypress-cli#installation).", "title": "Cypress CLI" } [/block] ## Direct Download You can download Cypress directly [here.](http://download.cypress.io/desktop) [block:callout] { "type": "danger", "body": "The vast majority of the time, Cypress will install correctly. But if you're on Linux you [might have to install some other dependencies](https://on.cypress.io/guides/continuous-integration#section-dependencies).", "title": "Woops, I got an error installing" } [/block] *** # Logging In After installing, you will need to login to Cypress. Login currently requires a [Github](https://github.com/) account, if you do not have an account, you will have to [create one](https://github.com/join) to use Cypress. **To Login:** - Open the Cypress App -- just double click the app from your OS applications folder. - Click "Log In with GitHub". - Authorize GitHub access to your account. ![Log In to Cypress](https://cloud.githubusercontent.com/assets/1271364/18134962/38a6c3d8-6f6e-11e6-998b-9884496cb898.png) ## Your email: [email protected]` has not been authorized. While in beta, the Cypress team has to whitelist the email address associated with your GitHub account in order for you to use Cypress. - If you received this error and have never filled out our [Early Adopter Access](http://goo.gl/forms/4vEMwj8LNT) form, fill out this form with the email in the error so we can whitelist it. You will receive an invite during one of our future Beta invites. - If you received this error after receiving a Beta invite email from Cypress, please send an email to [email protected]** telling us the email in the error so we can whitelist it. *** # Adding Projects After successfully logging in, you will need to add the project(s) you want to write Cypress tests in. - Click :fa-plus: Add Project. ![Add Project in LeftHand Corner](https://cloud.githubusercontent.com/assets/1271364/22699969/fe44c2e4-ed26-11e6-83d0-9baa0f51b15e.png) [block:callout] { "type": "info", "body": "Projects added in our Desktop Application are strictly local to your computer. They are not tracked in any way by Cypress servers and do not communicate with us until they are [setup to be recorded](https://on.cypress.io/guides/projects#section-recording-runs)." } [/block] *** # Running Tests from the GUI To run tests: - Click on the project. - You will then come to a page listing all files in your project's `cypress/integration` folder. If it's a new project, you'll see a message about the folder structure generated for you and also an `example_spec.js` file. - Click on the test file you want to run or click "Run All Tests". - After opening your project in Cypress, Cypress will generate a `cypress.json` file in your project: [block:code] { "codes": [ { "code": "<your project>/cypress.json\n", "language": "text" } ] } [/block] This file contains a unique `projectId` and allows for specific Cypress [configuration](https://on.cypress.io/guides/configuration). It is okay to commit this file to `git`. *** # Running Headlessly While you'll find yourself working primarily in the GUI, it is helpful to be able to run your tests headlessly. Once you have the [Cypress CLI Tool](https://github.com/cypress-io/cypress-cli) installed, you can simply execute: [block:code] { "codes": [ { "code": "cypress run\n", "language": "shell" } ] } [/block] Additionally you can specify: - a single test file - [a specific reporter and reporter options](https://on.cypress.io/guides/reporters) - a different port - environment variables You can [read about all of these options](https://github.com/cypress-io/cypress-cli#cypress-run-1) which are documented on the Cypress CLI tool.