jiripavlicek/slack-codeception-extension

该包的最新版本(1.8.1)没有可用的许可证信息。

此包为Codeception提供了扩展功能,可以将测试结果广播到Slack聊天室。

1.8.1 2021-09-14 07:50 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

      # Whether or not to show number of skipped tests in the summary. Default value: 'false'
      showNumberOfSkipped: true

      # 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进行通信。