Skip to content

Commit a824282

Browse files
author
Robbie
committed
Initial commit
0 parents  commit a824282

File tree

6 files changed

+467
-0
lines changed

6 files changed

+467
-0
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/vendor
2+
/composer.lock
3+
.DS_Store
4+
.idea
5+
*.yml

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2016
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
slack-codeception-extension
2+
=============================
3+
This package provides an extension for Codeception to send test results to Slack channels and/or users.
4+
5+
Pre-requisites
6+
-------------
7+
8+
- a pre-configured webhook from the Slack integration "Incoming Webhook"
9+
(see https://api.slack.com/incoming-webhooks for more information)
10+
11+
Installation
12+
-----------
13+
14+
Add the package `ngraf/slack-codeception-extension` to `composer.json` manually or type this in console:
15+
16+
composer require ngraf/slack-codeception-extension
17+
18+
Usage
19+
-----
20+
Enable and configure the extension in your `codeception.yaml`
21+
22+
**Basic** usage:
23+
24+
extensions:
25+
enabled:
26+
- Codeception\Extension\SlackExtension
27+
config:
28+
Codeception\Extension\SlackExtension:
29+
webhook: https://hooks.slack.com/services/...
30+
31+
**Advanced** usage:
32+
33+
extensions:
34+
enabled:
35+
- Codeception\Extension\SlackExtension
36+
config:
37+
Codeception\Extension\SlackExtension:
38+
webhook: https://hooks.slack.com/services/...
39+
40+
# possible notification strategies: always|successonly|failonly|failandrecover|statuschange
41+
strategy: always
42+
43+
# If 'true' details about failed tests will be displayed. Default value: 'false'
44+
extended: true
45+
46+
# Limit the size of error messages in extended mode. 0 = unlimited. Default value: 80
47+
extendedMaxLength: 80
48+
49+
# Limit the amount of reported errors in extended mode. 0 = unlimited. Default value: 0
50+
extendedMaxErrors: 10
51+
52+
# customize your message with additional prefix and/or suffix
53+
54+
messagePrefix: '*Smoke-Test*'
55+
messageSuffix: <http://my-ci/my-job|Link>
56+
messageSuffixOnFail: <!channel>
57+
58+
# optional config keys that will overwrite the default configuration of the webhook
59+
60+
channel: '#any-channel,@any-user'
61+
channelOnFail: '#any-channel,@any-user'
62+
username: CI
63+
icon: :ghost:
64+
65+
Example
66+
-----
67+
68+
![slack-example](slack-example.png)
69+
70+
Dependencies
71+
-----
72+
This package uses the package [maknz/slack](https://github.com/maknz/slack) to communicate with the Slack API.

composer.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "ngraf/slack-codeception-extension",
3+
"description": "This package provides an extension for Codeception to broadcast test results in Slack messenger ",
4+
"keywords": [
5+
"codeception",
6+
"slack",
7+
"extension"
8+
],
9+
"authors": [
10+
{
11+
"name": "Norbert Graf",
12+
"email": "[email protected]",
13+
"homepage": "https://github.com/ngraf",
14+
"role": "Developer"
15+
}
16+
],
17+
"autoload": {
18+
"psr-4": {
19+
"Codeception\\": "src"
20+
}
21+
},
22+
"require": {
23+
"alek13/slack": "^2.0"
24+
}
25+
}

slack-example.png

26.8 KB
Loading

0 commit comments

Comments
 (0)