Overview
Uptime Kuma Steps adds step definitions to Webship-js 2.0.x for the markup the platform itself renders, regardless of theme or distribution, so scenarios read as plain sentences instead of CSS selectors. It is a plugin for Webship-js: it ships one file of step definitions you drop into an existing test project, and it composes with the built-in steps rather than duplicating them.
Install
npm install --save-dev @webship-js/uptime-kuma-steps
Then add its step file to cucumber.js beside the Webship-js steps:
require: [
'node_modules/webship-js/tests/step-definitions/**/*.js',
'node_modules/@webship-js/uptime-kuma-steps/tests/step-definitions/*.js',
'tests/step-definitions/**/*.js',
]
Test users
The steps that log in use accounts that already exist on the site, by the handle a feature names (Given I am a logged in user with the "admin" user). The site build creates them; a feature never creates or deletes an account. They are listed in cucumber.js under worldParameters. These are the test accounts of the pack's own test site: put the accounts of your site in your project, and keep real passwords in environment variables.
{
"worldParameters": {
"users": {
"admin": {
"username": "admin"
}
}
}
}
Steps
- When I sign in to the monitoring dashboard as "admin"
- Given I am signed in to the monitoring dashboard as "admin"
- When I sign out of the monitoring dashboard
- Then I should be signed out of the monitoring dashboard
- Then the login form should say "Incorrect username or password."
- When I add a push monitor named "Nightly backup"
- When I add an HTTP monitor named "Home page" for "http://localhost:3001"
- When I pause the "Nowhere" monitor
- Then the "Kuma itself" monitor should be up
- Then the "Nowhere" monitor should be paused
- Then the 24-hour uptime of the "Kuma itself" monitor should be "100%"
- Then the "Kuma itself" monitor should have at least 1 heartbeat
- When the "Checkout push" monitor gets a push up
- When I search the monitors for "Kuma"
- When I filter the monitors by "Down"
- Then the monitor list should show "Kuma itself"
- Then the dashboard should count 2 monitors up
- Then the important events should show "Nowhere"
- Then I should see the toast "Paused Successfully."
- When I close the toast "[Nowhere] [DOWN]"
- When I open the "shop" status page
- Then the status page should say "Partially Degraded Service"
- Then the status page should list the "Kuma itself" monitor
- Then the status page should show the maintenance "Database upgrade"
- When I start the "Database upgrade" maintenance
- Then the "Database upgrade" maintenance should be inactive
Every assertion step reads both polarities from one definition: should see and should not see are the same step. Source and issues: github.com/webship/uptime-kuma-steps.
Logo
The logo is Simple Icons' Uptime Kuma icon (icons/uptimekuma.svg of simple-icons 16.37.0, CC0-1.0), in the colour the set lists for the brand; its path is unmodified. Uptime Kuma and its mark are its author's: the logo names the app the pack tests. It is not covered by this package's licence.