Skip to content
/ cy-skeleton Public template

Cypress template to make starting a new project faster.

Notifications You must be signed in to change notification settings

cjbramble/cy-skeleton

Repository files navigation

Cypress Skeleton


Installation

Clone repository with SSH:

git clone <replace>

Switch to root of project:

cd <replace>

Install package:

npm install

Test install succeded:

./node_modules/.bin/cypress open


Configuration

In cypress.json the baseUrl is currently set to .

To override or use additional configurations create a separate cypress.env.json.

Example:

{
    "baseUrl": "<replace>"
}

Usage

We use custom Scripts in package.json to open Cypress, run all tests, and some other things from the command line.

"scripts": {
    "cy:open": "cypress open",
    "cy:run": "cypress run",
    "git:hook": "husky install",
    "format": "prettier --write ."
}

To open Cypress:

npm run cy:open

To run all tests:

npm run cy:run


Formatter

We're going to let robots do some formatting for us. Enable the git hook for Prettier by using a couple of scripts from package.json.

npm run git:hook

Now every time you make a commit the formatter will run. If you wish to run the formatter prior to commit (recommended) then just use the format script.

npm run format

Official Cypress Docs

https://docs.cypress.io/guides/overview/why-cypress

About

Cypress template to make starting a new project faster.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published