0.1.0 • Published 4 months ago
@seriesfi/cypress-courier v0.1.0
@seriesfi/cypress-courier
A Cypress plugin for handling email testing with Courier. This plugin provides utilities and commands for testing email functionality in your Cypress tests.
Installation
npm install --save-dev @seriesfi/cypress-courier
Usage
- Import the plugin in your
cypress/support/e2e.ts
:
import "@seriesfi/cypress-courier";
- Configure your Cypress environment variables in
cypress.env.json
:
{
"courierApiKey": "your-courier-api-key"
}
- Use the provided commands in your tests:
cy.getCourierEmail("recipient@example.com")
.should("have.subject", "Welcome Email")
.and("contain.text", "Welcome to our platform!");
Available Commands
cy.getCourierEmail(email)
: Get the latest email for a recipientcy.waitForCourierEmail(email, options)
: Wait for an email to arrivecy.clearCourierEmails(email)
: Clear all emails for a recipient
License
MIT