ngraf/slack-codeception-extension

此软件包最新版本(1.8.0)没有可用的许可信息。

此软件包为Codeception提供扩展,用于在Slack即时通讯中广播测试结果。

1.8.0 2020-05-12 15:08 UTC

README

此软件包为Codeception提供扩展,可以将测试结果发送到Slack频道和/或用户。

先决条件

安装

手动将软件包ngraf/slack-codeception-extension添加到composer.json中,或在控制台输入以下命令

composer require ngraf/slack-codeception-extension

使用方法

在您的codeception.yaml中启用并配置该扩展

基本使用

extensions:
  enabled:
    - Codeception\Extension\SlackExtension
  config:
    Codeception\Extension\SlackExtension:
       webhook: https://hooks.slack.com/services/...

高级使用

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

示例

slack-example

依赖项

此软件包使用maknz/slack软件包与Slack API进行通信。