|
| 1 | +slack-codeception-extension |
| 2 | +============================= |
| 3 | +This package provides an extension for Codeception to send test results to Slack channels and/or users. |
| 4 | + |
| 5 | +Pre-requisites |
| 6 | +------------- |
| 7 | + |
| 8 | +- a pre-configured webhook from the Slack integration "Incoming Webhook" |
| 9 | +(see https://api.slack.com/incoming-webhooks for more information) |
| 10 | + |
| 11 | +Installation |
| 12 | +----------- |
| 13 | + |
| 14 | +Add the package `ngraf/slack-codeception-extension` to `composer.json` manually or type this in console: |
| 15 | + |
| 16 | + composer require ngraf/slack-codeception-extension |
| 17 | + |
| 18 | +Usage |
| 19 | +----- |
| 20 | +Enable and configure the extension in your `codeception.yaml` |
| 21 | + |
| 22 | +**Basic** usage: |
| 23 | + |
| 24 | + extensions: |
| 25 | + enabled: |
| 26 | + - Codeception\Extension\SlackExtension |
| 27 | + config: |
| 28 | + Codeception\Extension\SlackExtension: |
| 29 | + webhook: https://hooks.slack.com/services/... |
| 30 | + |
| 31 | +**Advanced** usage: |
| 32 | + |
| 33 | + extensions: |
| 34 | + enabled: |
| 35 | + - Codeception\Extension\SlackExtension |
| 36 | + config: |
| 37 | + Codeception\Extension\SlackExtension: |
| 38 | + webhook: https://hooks.slack.com/services/... |
| 39 | + |
| 40 | + # possible notification strategies: always|successonly|failonly|failandrecover|statuschange |
| 41 | + strategy: always |
| 42 | + |
| 43 | + # If 'true' details about failed tests will be displayed. Default value: 'false' |
| 44 | + extended: true |
| 45 | + |
| 46 | + # Limit the size of error messages in extended mode. 0 = unlimited. Default value: 80 |
| 47 | + extendedMaxLength: 80 |
| 48 | + |
| 49 | + # Limit the amount of reported errors in extended mode. 0 = unlimited. Default value: 0 |
| 50 | + extendedMaxErrors: 10 |
| 51 | + |
| 52 | + # customize your message with additional prefix and/or suffix |
| 53 | + |
| 54 | + messagePrefix: '*Smoke-Test*' |
| 55 | + messageSuffix: <http://my-ci/my-job|Link> |
| 56 | + messageSuffixOnFail: <!channel> |
| 57 | + |
| 58 | + # optional config keys that will overwrite the default configuration of the webhook |
| 59 | + |
| 60 | + channel: '#any-channel,@any-user' |
| 61 | + channelOnFail: '#any-channel,@any-user' |
| 62 | + username: CI |
| 63 | + icon: :ghost: |
| 64 | + |
| 65 | +Example |
| 66 | +----- |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +Dependencies |
| 71 | +----- |
| 72 | +This package uses the package [maknz/slack](https://github.com/maknz/slack) to communicate with the Slack API. |
0 commit comments