/codeceptjs-mailhog-helper

Test your email with Mailhog and CodeceptJS

Primary LanguageJavaScript

codeceptjs-mailhog-helper

codeceptjs-mailhog-helper is a CodeceptJS helper to add integrations for MailHog.

Installation

$ npm i codeceptjs-mailhog-helper --save

Configuration

codecept.conf.js

helpers: {
    MailHog: {
        require: 'codeceptjs-mailhog-helper',
        endpoint: 'http://localhost:8025/api/v2
    }
},

Options:

Usage

// Get latest EMail content by recipient address and subject
let content = await I.grabContentFromEmail(mailto, subject)

// get latest EMail content by recipient address, subject, body
let content = await I.grabContentFromEmail(mailto, subject, body)

// find URL string from latest EMail content
let url = await I.grabUrlFromEmail(mailto, subject)
let url = await I.grabUrlFromEmail(mailto, subject, body)