ngraf/slack-codeception-extension
此软件包最新版本(1.8.0)没有可用的许可信息。
此软件包为Codeception提供扩展,用于在Slack即时通讯中广播测试结果。
1.8.0
2020-05-12 15:08 UTC
Requires
- alek13/slack: ^1.7
README
此软件包为Codeception提供扩展,可以将测试结果发送到Slack频道和/或用户。
先决条件
- 从Slack集成“入站Web钩子”配置了一个预配置的webhook(更多信息请见https://api.slack.com/incoming-webhooks)
安装
手动将软件包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:
示例
依赖项
此软件包使用maknz/slack软件包与Slack API进行通信。