https://github.com/bahmutov/cypress-sendgrid-visual-testing-example
Visual testing for HTML emails sent via SendGrid design templates
https://github.com/bahmutov/cypress-sendgrid-visual-testing-example
cypress-email-example cypress-example
Last synced: 9 months ago
JSON representation
Visual testing for HTML emails sent via SendGrid design templates
- Host: GitHub
- URL: https://github.com/bahmutov/cypress-sendgrid-visual-testing-example
- Owner: bahmutov
- Created: 2021-05-19T13:00:53.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-23T08:04:09.000Z (over 1 year ago)
- Last Synced: 2024-10-24T15:54:35.983Z (over 1 year ago)
- Topics: cypress-email-example, cypress-example
- Language: JavaScript
- Homepage:
- Size: 1.18 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cypress-sendgrid-visual-testing-example 
> 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](https://sendgrid.com/docs/for-developers/sending-email/quickstart-nodejs/)
## Install
```shell
$ 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](https://github.com/bahmutov/as-a) utility
```shell
$ 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.
```shell
# 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](https://percy.io/bahmutov/cypress-sendgrid-visual-testing-example)