diff --git a/commands.js b/commands.js index 22640d8d773f80f2fa9c6e49b8e558590c693ac1..77f508616e6923a13945627d7c58fb0eedd565ee 100644 --- a/commands.js +++ b/commands.js @@ -134,3 +134,13 @@ Cypress.Commands.add('assertMailpitInbox', (callback) => { callback(resp); }) }) + +Cypress.Commands.add('assertMailpitMessage', (id, callback) => { + cy.request({ + url: Cypress.env('mailpitUrl') + '/api/v1/message/' + id, + accept: 'application/json' + }).then((resp) => { + expect(resp.status).to.eq(200); + callback(resp); + }) +})