email-notification
v1.0.0
Published
This project uses mailosaur api service to search for emails by link and/or subject from email server.
Downloads
60
Maintainers
Readme
email-notification:
This is a npm module to search for emails sent to mailosaur mail server - by Subject and Links (in email html).
Install:
npm install email-notification
Environment Variables:
Set following environment variables on your machine/CI variables/.env:
MAILOSAUR_API_KEY = api key for your mailosaur account
MAILOSAUR_SERVER_ID = server id for your mailosaur account
Usage:
Sample usage example from a UI solution page object and its calling in test:
eMail by Subject in page object:
const email = require('email-notification');
const emailSubject = email.emailBySubject();
This method would return the subject for matching email
async emailConfirmation(completeEmailAddress, searchByText) {
await emailSubject.getEmailSubject(completeEmailAddress, searchByText);
}
calling from test (search by subject-text)
await page.emailConfirmation('[email protected]', 'Reset your password');
eMail by Link in page object:
const email = require('email-notification');
const emailLink = email.emailByLink();
This method would return the link from matching email
async emailConfirmation(completeEmailAddress, searchByLinkHref) {
await emailLink.getEmailData(completeEmailAddress, searchByLinkHref);
}
calling from test ( search by link href in email)
await page.emailConfirmation('[email protected]', 'mailto:[email protected]');