netlify-plugin-cypress

Never deploy a broken site

Gleb Bahmutov

VP of Engineering

@bahmutov

deploy to Netlify!

source

tests

Ughh, automatic deploy had a bug 😢

I want to run E2E tests before deploy!

🎉 https://github.com/netlify/build 🎉

module.exports = {
  onPrebuild,
  onBuild,
  onPostBuild
}

// make sure Cypress is installed

// run Cypress tests against "public" folder

build plugin

npm i -D netlify-plugin-cypress

[[plugins]]
  # local Cypress plugin will test our site after it is built
  package = "netlify-plugin-cypress"

Any Netlify User

[[plugins]]
  # local Cypress plugin will test our site after it is built
  package = "netlify-plugin-cypress"
  [plugins.inputs]
    record = true

Record Test Artifacts

[[plugins]]
  # local Cypress plugin will test our site after it is built
  package = "netlify-plugin-cypress"
  [plugins.inputs]
    record = true
    group = "built site"
    tag = "nightly,production"

Tag Test Runs

[[plugins]]
  # local Cypress plugin will test our site after it is built
  package = "netlify-plugin-cypress"
  [plugins.inputs]
    spec = "cypress/integration/smoke*.js"

Run Some Specs

Example

Failing Example

I want to run E2E tests before and AFTER deploy!

module.exports = {
  onPrebuild,
  onBuild,
  onPostBuild,
  onPostDeploy
}

// make sure Cypress is installed

// run Cypress tests against "public" folder

build plugin

// run Cypress tests after deployment

Big Thank You

Netlify Team

@bahmutov