codeceptjs-mailhog-helper is a CodeceptJS helper to add integrations for MailHog.
$ npm i codeceptjs-mailhog-helper --save
codecept.conf.js
helpers: {
MailHog: {
require: 'codeceptjs-mailhog-helper',
endpoint: 'http://localhost:8025/api/v2
}
},
Options:
endpoint
: Endpoint URL of mailhog API v2 (default to 'http://localhost:8025/api/v2)
// 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)