bahmutov / cypress-sendgrid-visual-testing-example

Visual testing for HTML emails sent via SendGrid design templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cypress-sendgrid-visual-testing-example cypress version

Visual testing for HTML emails sent via SendGrid dynamic transactional templates

Prerequisites

SendGrid account with API key and a verified email sender, see this doc

Install

$ npm install

Run

Start the server locally with injected SENDGRID_API_KEY and SENDGRID_FROM environment variables.

SENDGRID_API_KEY=... SENDGRID_FROM=... npm start

Tip: use as-a utility

$ as-a cypress-sendgrid-visual-testing-example npm start

When running the tests locally if we want to send visual results to Percy we need the PERCY_TOKEN environment variable.

# without visual tests
$ npx cypress open
# with visual tests
$ PERCY_TOKEN=... npx percy exec -- npx cypress open
$ as-a cypress-sendgrid-visual-testing-example-percy npx percy exec -- npx cypress open

You can find the Percy visual results at percy.io/bahmutov/cypress-sendgrid-visual-testing-example

About

Visual testing for HTML emails sent via SendGrid design templates


Languages

Language:JavaScript 100.0%