CodeceptJS helper for testing webhook calls
npm install codeceptjs-webhook-helperhttp library, with a given port on the localhost.
http://localhost:/**
npm i codeceptjs-webhook-helper --save
`
Configuration
codecept.conf.js
`
helpers: {
WebHookHelper: {
require: 'codeceptjs-webhook-helper',
port: 9999,
waitForTimeout: 10
}
},
`
Options:
- port: The port to start the webhook server. Default is 5431
- waitForTimeout: Indicates for how many seconds to wait
for verifying the given webhook called or
not during I.waitForWebHookCall().
Default is 10 seconds
Usage
`javascript
// Wait for a webhook call: "/testing/with/codecept"
I.waitForWebHookCall('/testing/with/codecept')
// Wait for a webhook call: "/testing/with/codecept"
// with overriding the wait timeout in the options.
// This will wait for 20 seconds
I.waitForWebHookCall('/testing/with/codecept', 20)
``