Dev Docs
  • Introduction
  • Becoming an ORCA Developer
  • Why Sign Up?
  • Developer Resources
  • Understanding Service Apps
  • How to Create a Service App for the ORCA Marketplace
  • Available Permissions
  • How to Request Permissions for a Service App
  • Happy Hours Admin
    • Happy Hours Admin
  • Cyress Tests
    • Cypress Test
  • Orca API
    • Education/Breakaway
    • TypeForm WebHook
    • getOrcaVideoList
    • getPremiumCourses
    • getCourseUsers
    • getDashBoardHeroStatistics
    • getUserProgress
    • Remove CE Credit
    • Add CE Credit
  • TypeForm
    • Setup a webHook on TypeForm
  • Database Migrations
    • MySQL Import Data using Laravel Seeds.
Powered by GitBook
On this page
  • Installing
  • npm install
  • yarn add
  • Opening Cypress
  • Switching browsers
  • Adding npm scripts
  1. Cyress Tests

Cypress Test

Framework to do all test(End-to-end; Integration; unit)

PreviousHappy Hours AdminNextEducation/Breakaway

Last updated 5 years ago

Installing

npm install

Install Cypress via npm:

cd /your/project/path
npm install cypress --save-dev

Make sure that you have already run or have a node_modules folder or package.json file in the root of your project to ensure cypress is installed in the correct directory.

yarn add

Installing Cypress via :

cd /your/project/path
yarn add cypress --dev

Opening Cypress

If you used npm to install, Cypress has now been installed to your ./node_modules directory, with its binary executable accessible from ./node_modules/.bin.

Now you can open Cypress from your project root one of the following ways:

The long way with the full path

./node_modules/.bin/cypress open

Or with the shortcut using npm bin

$(npm bin)/cypress open

Or by using npx

npx cypress open

Or by using yarn

yarn run cypress open

After a moment, the Cypress Test Runner will launch.

Switching browsers

The Cypress Test Runner attempts to find all compatible browsers on the user’s machine. The drop down to select a different browser is in the top right corner of the Test Runner.

Adding npm scripts

While there’s nothing wrong with writing out the full path to the Cypress executable each time, it’s much easier and clearer to add Cypress commands to the scripts field in your package.json file.

{
  "scripts": {
    "cypress:open": "cypress open"
  }
}

Now you can invoke the command from your project root like so:

npm run cypress:open

…and Cypress will open right up for you.

note: is included with npm > v5.2 or can be installed separately.

npm init
yarn
npx
Cypress Test Runner