Skip to main content

Cypress

ZeroDrop works with Cypress for end-to-end email testing. No Docker, no SMTP server, no mocking.

Installation

Setup

Cypress runs your spec files in the browser. There, ZeroDrop’s client can’t read ZERODROP_API_KEY, and the browser blocks requests to the ZeroDrop API because it’s on another origin. So run the client in Cypress’s Node process and call it from your specs with cy.task:
If no email arrives in time, or ZeroDrop held the email, cy.task('waitForEmail') fails the test with the client’s error message.

Email verification

OTP verification

In GitHub Actions

Without an API key, one sender can reach only 5 different inboxes a day, and each test above uses its own inbox. Get a free key at zerodrop.dev/keys, save it as the repository secret ZERODROP_API_KEY, and pass it to the step that runs Cypress:
The newInbox task makes a fresh inbox for each test, so you don’t need the setup-zerodrop action here. Inbox names then start with your key’s prefix, and only your key can read them.