0.2.0 • Published 4 years ago

mailosaur-cypress v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

mailosaur-cypress

This package provides Cypress commands to help you test email and SMS as part of end-to-end testing.

Install and configure

1. Install via npm

npm install mailosaur-cypress --save-dev

2. Include the commands

Add the following line to cypress/support/index.js:

import 'mailosaur-cypress'

3. Add your Mailosaur API key as an environment variable

Mailosaur commands need your Mailosaur API key to work. We recommend that you set this using an environment variable:

export CYPRESS_MAILOSAUR_API_KEY=yourapikey

Commands

cy.mailosaurGetMessage

it('Should find my email', () => {
  cy.mailosaurGetMessage('SERVER_ID', { subject: 'Hello world' }).then(result => {
    expect(result.subject).to.be('Hello world')
  })
})

All commands

'mailosaurListServers',
'mailosaurCreateServer',
'mailosaurGetServer',
'mailosaurUpdateServer',
'mailosaurDeleteServer',
'mailosaurListMessages',
'mailosaurCreateMessage',
'mailosaurGetMessage',
'mailosaurGetMessageById',
'mailosaurSearchMessages',
'mailosaurGetMessageBySubject',
'mailosaurGetMessageByBody',
'mailosaurGetMessageBySentTo',
'mailosaurDeleteMessage',
'mailosaurDeleteAllMessages',
'mailosaurDownloadAttachment',
'mailosaurDownloadMessage',
'mailosaurGetSpamAnalysis'