codeception-module-mailcare

MailCare module for Codeception

Installation

composer require "mailcare/codeception-module-mailcare"

Documentation

Module for testing receiving emails using MailCare.

Configuration

Example

modules:
    enabled
        - MailCare:
            url: 'https://mailix.xyz/api'
            login: 'https://mailix.xyz/api'
            password: 'https://mailix.xyz/api'

Criterias

All criterias can be found in the API Documentation of MailCare except for page and limit.

Examples of since with ISO 8601 durations:

Actions

seeEmailCount

Checks that the email count equals expected value. Waits up to $timeout seconds for the given email to be received.

$I->seeEmailCount(2, [
    'inbox' => 'john@example.org',
    'sender' => 'no-reply@company.com',
    'subject' => 'Welcome John!',
    'since' => 'PT2M',
], 30);

seeEmail

Checks that the given email exists. Waits up to $timeout seconds for the given email to be received.

$I->seeEmail([
    'inbox' => 'john@example.org',
    'sender' => 'no-reply@company.com',
    'subject' => 'Welcome John!',
    'since' => 'PT2M',
], 30);

dontSeeEmail

Opposite to seeEmail.

$I->dontSeeEmail([
    'inbox' => 'john@example.org',
    'since' => 'PT2M',
], 30);

grabLinksInLastEmail

In the last email, grabs all the links Waits up to $timeout seconds for the given email to be received.

$I->grabLinksInLastEmail([
    'inbox' => 'john@example.org',
    'since' => 'PT2M',
], 30);

grabTextInLastEmail

In the last email, grabs all the text corresponding to a regex. Waits up to $timeout seconds for the given email to be received.

$I->grabTextInLastEmail('#Password: (?<password>\S+)#', [
    'inbox' => 'john@example.org',
    'subject' => 'Your credentials',
    'since' => 'PT2M',
], 30);