An open API service indexing awesome lists of open source software.

https://github.com/punktde/codeception-mailhog


https://github.com/punktde/codeception-mailhog

codeception

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# punktde/codeception-mailhog

## Gherkin Steps and module functions to test using Mailhog

### How to use

### Prequesits

You have to have Mailhog installed and have your application configured to send mails to mailhog. See https://github.com/mailhog/MailHog

#### Module

You have to add the `Webdriver` module to your config to use the `Mailhog` module.
Use the module `PunktDe\Codeception\Mailhog\Module\Mailhog` in your `codeception.yaml`. You can configure under which uri the mailhog client is reachable (default is http://127.0.0.1:8025)

```yaml
modules:
enabled:
- WebDriver:
url: 'http://acceptance.dev.punkt.de/'
browser: chrome
restart: true
window_size: 1920x2080
capabilities:
chromeOptions:
args:
- '--headless'
- '--disable-gpu'
- '--disable-dev-shm-usage'
- '--no-sandbox'
- PunktDe\Codeception\Mailhog\Module\Mailhog:
base_uri: http://mailhog.project
```

#### Gherkin steps

Just add the trait `PunktDe\Codeception\Mailhog\ActorTraits\Mailhog` to your testing actor. Then you can use `*.feature` files to write your gherkin tests with the new steps.

##### Example actor

```php