2017 © Pedro Peláez
 

library codeception-smtp-mail

Test emails in your Codeception acceptance tests

image

ahmedsamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  • Monday, October 23, 2017
  • by ahmed.samy
  • Repository
  • 1 Watchers
  • 7 Stars
  • 47,993 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 6 Forks
  • 2 Open issues
  • 12 Versions
  • 13 % Grown

The README.md

Installation

``` bash $ composer require ahmedsamy/codeception-smtp-mail, (*1)


### Configuration in `acceptance.yml` ``` yaml modules: enabled: - Smtp: username: name@email.com password: password

Build codeception, (*2)

``` bash $ bin/codecept build, (*3)


### Available methods - ``` seeEmail($criteria) ``` - ``` canSeeEmail($criteria) ``` - ``` seeEmail($criteria) ``` - ``` cantSeeEmail($criteria) ``` - ``` dontSeeEmail($criteria) ``` - ``` openEmail($criteria) ``` - ``` grabEmail() ``` - ``` grabLinkFromEmail($url) ``` - ``` clickInEmail($url) ``` - ``` canSeeLinkInEmail($url) ``` - ``` seeLinkInEmail($url) ``` - ``` cantSeeLinkInEmail($url) ``` - ``` dontSeeLinkInEmail($url) ``` - ``` canSeeEmailAttachmentsCount($count) ``` - ``` canSeeEmailAttachment($name) ``` - ``` countEmailsByCriteria($criteria) ``` * $criteria is according to imap syntax, see http://php.net/manual/en/function.imap-search.php ### Examples Checking email with subject and date ``` php $I->seeEmailBy('SUBJECT "HOWTO be Awesome" SINCE "8 August 2008"'); $I->canSeeEmail('SUBJECT "Welcome Email"'); $I->openEmail('SUBJECT "Open me"'); $I->canSeeEmail('SUBJECT "good words"'); $I->seeLinkInEmail('http://google.com/awesome'); $I->clickInEmail("http://google.com/awesome"); $I->grabLinkFromEmail("http://google.com/awesome"); $I->canSeeEmailAttachmentsCount(2); $I->canSeeEmailAttachment('contract.pdf'); //accepts full file name or part of it

Configuration reference

``` yaml Smtp: username: username@domain.com #required password: password123 #required imap_path: {imap.gmail.com:993/imap/ssl}INBOX #imap path defaults to gmail config wait_interval: 1 #waiting interval between trials in seconds retry_counts: 3 # how many trials till attachments_dir: tests/_data #where email attachments are stored auto_clear_attachments: true #whether to clear attachments folder every run or not, (*4)

```, (*5)

TODOs

  • Write tests
  • Add travis.yml

The Versions

23/10 2017

dev-master

9999999-dev https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

23/10 2017

v0.8.2

0.8.2.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

23/10 2017

v0.8.1

0.8.1.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

16/06 2017

v0.8

0.8.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

12/06 2017

v0.7

0.7.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

06/01 2016

v0.6

0.6.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

18/09 2015

v0.5

0.5.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

17/09 2015

v0.4.1

0.4.1.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

17/09 2015

v0.4

0.4.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

11/09 2015

v0.3

0.3.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

09/09 2015

v0.2

0.2.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit

09/09 2015

v0.1

0.1.0.0 https://github.com/AhmedSamy/codeception-smtp-mail

Test emails in your Codeception acceptance tests

  Sources   Download

MIT

The Requires

 

php gmail smtp codeception php unit