项目作者: ngraf

项目描述 :
Provides an extension for Codeception to broadcast test results in Slack messenger
高级语言: PHP
项目地址: git://github.com/ngraf/slack-codeception-extension.git
创建时间: 2016-12-30T08:55:48Z
项目社区:https://github.com/ngraf/slack-codeception-extension

开源协议:MIT License

下载


slack-codeception-extension

This package provides an extension for Codeception to send test results to Slack channels and/or users.

Pre-requisites

Installation

Add the package ngraf/slack-codeception-extension to composer.json manually or type this in console:

  1. composer require ngraf/slack-codeception-extension

Usage

Enable and configure the extension in your codeception.yaml

Basic usage:

  1. extensions:
  2. enabled:
  3. - Codeception\Extension\SlackExtension
  4. config:
  5. Codeception\Extension\SlackExtension:
  6. webhook: https://hooks.slack.com/services/...

Advanced usage:

  1. extensions:
  2. enabled:
  3. - Codeception\Extension\SlackExtension
  4. config:
  5. Codeception\Extension\SlackExtension:
  6. webhook: https://hooks.slack.com/services/...
  7. # possible notification strategies: always|successonly|failonly|failandrecover|statuschange
  8. strategy: always
  9. # If 'true' details about failed tests will be displayed. Default value: 'false'
  10. extended: true
  11. # Limit the size of error messages in extended mode. 0 = unlimited. Default value: 80
  12. extendedMaxLength: 80
  13. # Limit the amount of reported errors in extended mode. 0 = unlimited. Default value: 0
  14. extendedMaxErrors: 10
  15. # customize your message with additional prefix and/or suffix
  16. messagePrefix: '*Smoke-Test*'
  17. messageSuffix: <http://my-ci/my-job|Link>
  18. messageSuffixOnFail: <!channel>
  19. # optional config keys that will overwrite the default configuration of the webhook
  20. channel: '#any-channel,@any-user'
  21. channelOnFail: '#any-channel,@any-user'
  22. username: CI
  23. icon: :ghost:

Example

slack-example

Dependencies

This package uses the package maknz/slack to communicate with the Slack API.