7170 / slack-codeception-extension
此包最新版本(1.4.3)没有提供许可证信息。
此包为Codeception提供扩展,可在Slack消息传递中广播测试结果
1.4.3
2018-03-12 12:12 UTC
Requires
- maknz/slack: ^1.7
README
此包为Codeception提供扩展,用于将测试结果发送到Slack频道和/或用户。
先决条件
- 需要从Slack集成“ Incoming Webhook”配置预配置的webhook(更多信息请参阅 https://api.slack.com/incoming-webhooks)
安装
手动将包 7170/slack-codeception-extension
添加到 composer.json
或在控制台中输入此命令
composer require 7170/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
# 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进行通信。