ntfy
The atago project wrote these specs on its own initiative and runs them in its own CI, to exercise atago against a real program. They are not ntfy’s official test suite, and the ntfy project is not affiliated with atago.
Summary #
1 suite · 4 scenarios
Contents #
- ntfy (self-hosted push notification service) — 4 scenarios
ntfy (self-hosted push notification service) #
Source: test/e2e/thirdparty/ntfy/ntfy.atago.yaml
Scenario: the binary reports its version #
When #
ntfy --version
Then #
- exit code is
0 - stdout matches
/ntfy version [0-9]+\.[0-9]+\.[0-9]+/
Scenario: a published notification comes back through the JSON poll feed #
Given #
- Background service
ntfyis started:ntfy serve --listen-http 127.0.0.1:18180 --base-url http://127.0.0.1:18180 --cache-file data/cache.db. - Fixture file
data/.keepis created.
When #
# HTTP GET /v1/health
# HTTP POST /atago-alerts
# HTTP GET /atago-alerts/json?poll=1
# HTTP GET /other-topic/json?poll=1
Then #
- after
HTTP GET /v1/health:- HTTP status is
200 - body at
$.healthyequalstrue
- HTTP status is
- after
HTTP POST /atago-alerts:- HTTP status is
200 - body at
$.eventequalsmessage
- HTTP status is
- after
HTTP GET /atago-alerts/json?poll=1:- HTTP status is
200 - body at
$.titleequalsBackup done - body at
$.messageequalsnightly backup finished - body at
$.priorityequals4
- HTTP status is
- after
HTTP GET /other-topic/json?poll=1:- HTTP status is
200 - body is empty
- HTTP status is
Scenario: the bundled CLI publishes against the same server #
Given #
- Background service
ntfyis started:ntfy serve --listen-http 127.0.0.1:18181 --base-url http://127.0.0.1:18181 --cache-file data/cache.db. - Fixture file
data/.keepis created.
When #
ntfy publish http://127.0.0.1:18181/atago-deploys "deploy one"
ntfy publish http://127.0.0.1:18181/atago-deploys "deploy two"
# HTTP GET /atago-deploys/json?poll=1&since=all
Then #
- after
ntfy publish http://127.0.0.1:18181/atago-deploys "deploy one":- exit code is
0
- exit code is
- after
ntfy publish http://127.0.0.1:18181/atago-deploys "deploy two":- exit code is
0
- exit code is
- after
HTTP GET /atago-deploys/json?poll=1&since=all:- HTTP status is
200 - body contains
deploy one,deploy two
- HTTP status is
Scenario: deny-all access control locks a topic until a user is granted #
Given #
- Background service
ntfyis started:ntfy serve --listen-http 127.0.0.1:18182 --base-url http://127.0.0.1:18182 --cache-file data/cache.db --auth-file data/auth.db --auth-default-access deny-all. - Fixture file
data/.keepis created. - Environment variables are set: NTFY_PASSWORD.
When #
# HTTP POST /secure-topic
ntfy user add phil
ntfy access phil secure-topic rw
# HTTP POST /secure-topic
# HTTP GET /secure-topic/json?poll=1
Then #
- after
HTTP POST /secure-topic:- HTTP status is
403
- HTTP status is
- after
ntfy user add phil:- exit code is
0 - stdout contains
user phil added
- exit code is
- after
ntfy access phil secure-topic rw:- exit code is
0
- exit code is
- after
HTTP POST /secure-topic:- HTTP status is
200
- HTTP status is
- after
HTTP GET /secure-topic/json?poll=1:- HTTP status is
200 - body at
$.messageequalsauthorized message
- HTTP status is