From a51527ea5c15db40d0064ffe601036c5580b0dc7 Mon Sep 17 00:00:00 2001 From: Rajab Natshah Date: Fri, 4 Dec 2026 20:00:51 +0300 Subject: [PATCH 1/3] Add the step pack for Ruby on Rails apps (8.1 and 8.0) 22 steps on "the web application": users through the app's console, signing in and out, a scaffold's resources with Turbo's confirm and their errors, notices, cookie flags by scheme, CSRF and health checks, a password reset read from the mail catcher, the development error page, and no request outside its address. The demo app is made at the build; every secret is kept out of messages, failures and reports. Fixes #1 Co-Authored-By: Claude Opus 5.5 --- .github/scripts/build-demo.sh | 39 + .github/scripts/remove-demo.sh | 10 + .gitignore | 14 + README.md | 270 +- assets/logo.svg | 1 + cucumber.js | 144 + demo/Dockerfile | 12 + demo/rails-demo-app.sh | 119 + package-lock.json | 3080 +++++++++++++++++ package.json | 71 + playwright.config.ts | 39 + tests/check-examples.js | 145 + tests/check-must-fail.js | 120 + tests/check-paths.js | 95 + tests/features/app.feature | 15 + tests/features/notes.feature | 30 + tests/features/session.feature | 29 + tests/must-fail/web-app.feature | 72 + tests/step-definitions/rails-app.steps.js | 246 ++ .../step-definitions/rails-resources.steps.js | 253 ++ tests/step-definitions/rails-session.steps.js | 140 + tests/step-definitions/rails-support.js | 238 ++ tsconfig.json | 16 + 23 files changed, 5196 insertions(+), 2 deletions(-) create mode 100755 .github/scripts/build-demo.sh create mode 100755 .github/scripts/remove-demo.sh create mode 100644 .gitignore create mode 100644 assets/logo.svg create mode 100644 cucumber.js create mode 100644 demo/Dockerfile create mode 100755 demo/rails-demo-app.sh create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 playwright.config.ts create mode 100644 tests/check-examples.js create mode 100644 tests/check-must-fail.js create mode 100644 tests/check-paths.js create mode 100644 tests/features/app.feature create mode 100644 tests/features/notes.feature create mode 100644 tests/features/session.feature create mode 100644 tests/must-fail/web-app.feature create mode 100644 tests/step-definitions/rails-app.steps.js create mode 100644 tests/step-definitions/rails-resources.steps.js create mode 100644 tests/step-definitions/rails-session.steps.js create mode 100644 tests/step-definitions/rails-support.js create mode 100644 tsconfig.json diff --git a/.github/scripts/build-demo.sh b/.github/scripts/build-demo.sh new file mode 100755 index 0000000..b6979bc --- /dev/null +++ b/.github/scripts/build-demo.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# The demo of this pack's own suite: a line of the framework on the official Ruby image by its digest, its app made in +# the image (demo/rails-demo-app.sh), in development mode, capped at 512 MB, its mail to a mail catcher beside it +# (Mailpit, by digest, capped at 128 MB), run as the image's own user (the app is the image's), its secret_key_base from the environment into a file only you can read +# (never from a command line; it refuses to start without one). +# RAILS_DEMO_SECRET_KEY_BASE=… bash .github/scripts/build-demo.sh (8.1.4.1 or 8.0.5.2) +set -uo pipefail +LINE="${1:-8.1.4.1}" +RUBY='docker.io/library/ruby@sha256:5ac6b9f959a3356af5fc4f6a80a30106d99fd51785633f8a365be73cbe84e199' # 4.0.10-slim-bookworm +MAILPIT='docker.io/axllent/mailpit@sha256:1c0beb8db617aa61841cfcbb166529a6c246f606059038e3b0bf08d609fbfb3d' # v1.34.1 +case "${LINE}" in + 8.1.4.1) PORT=8780 ; MAIL=8790 ;; + 8.0.5.2) PORT=8781 ; MAIL=8791 ;; + *) echo "No line ${LINE}: the demo has 8.1.4.1 and 8.0.5.2." ; exit 1 ;; +esac +if [ "${#RAILS_DEMO_SECRET_KEY_BASE}" -lt 64 ] ; then + echo "Set RAILS_DEMO_SECRET_KEY_BASE in the environment (64 characters or more): the demo never runs without its secret." ; exit 1 +fi +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" +TAG="${LINE//./-}" ; NAME="rails-steps-${TAG}" ; DIR="${ROOT}/demo-app/${TAG}" ; NET="${NAME}-net" +docker rm -f "${NAME}" "${NAME}-mail" > /dev/null 2>&1 ; docker network rm "${NET}" > /dev/null 2>&1 +rm -rf "${DIR}" ; mkdir -p "${DIR}" ; chmod 700 "${DIR}" +( umask 077 ; printf '%s' "${RAILS_DEMO_SECRET_KEY_BASE}" > "${DIR}/secret_key_base" ) +docker image inspect "${NAME}" > /dev/null 2>&1 || docker build -q -t "${NAME}" --build-arg RAILS_VERSION="${LINE}" \ + --build-arg RUBY_IMAGE="${RUBY}" "${ROOT}/demo" > /dev/null || { echo "The demo's image could not be built." ; exit 1 ; } +docker network create "${NET}" > /dev/null || exit 1 +docker run -d --name "${NAME}-mail" --network "${NET}" --network-alias mail --memory 128m --memory-swap 128m \ + -p "127.0.0.1:${MAIL}:8025" "${MAILPIT}" > /dev/null || exit 1 +docker run -d --name "${NAME}" --network "${NET}" --memory 512m --memory-swap 512m -p "127.0.0.1:${PORT}:3000" \ + -e APP_HOST="127.0.0.1:${PORT}" -e APP_PROTOCOL=http -e SMTP_HOST=mail -e SMTP_PORT=1025 -e SIGN_IN_RATE_LIMIT=500 \ + -e SECRET_KEY_BASE_FILE=/run/demo/secret_key_base -v "${DIR}/secret_key_base:/run/demo/secret_key_base:ro" \ + "${NAME}" > /dev/null || exit 1 +for i in $(seq 1 90) ; do + if [ "$(curl -s -o /dev/null -w '%{http_code}' "http://127.0.0.1:${PORT}/up")" = 200 ] && curl -fs -o /dev/null "http://127.0.0.1:${MAIL}/api/v1/info" ; then + echo "The demo of Rails ${LINE} is up at http://127.0.0.1:${PORT} (its mail at http://127.0.0.1:${MAIL})." ; exit 0 + fi + sleep 1 +done +echo "The demo of Rails ${LINE} did not answer." ; docker logs --tail 40 "${NAME}" 2>&1 | sed -E 's/[0-9a-fA-F]{32,}/…/g' ; exit 1 diff --git a/.github/scripts/remove-demo.sh b/.github/scripts/remove-demo.sh new file mode 100755 index 0000000..548cc1d --- /dev/null +++ b/.github/scripts/remove-demo.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# Remove the demo of a line (its containers, its network, its files): bash .github/scripts/remove-demo.sh [--image] +set -uo pipefail +LINE="${1:-8.1.4.1}" +case "${LINE}" in 8.1.4.1|8.0.5.2) ;; *) echo "No line ${LINE}: the demo has 8.1.4.1 and 8.0.5.2." ; exit 1 ;; esac +ROOT="$(cd "$(dirname "$0")/../.." && pwd)" ; TAG="${LINE//./-}" ; NAME="rails-steps-${TAG}" +docker rm -f "${NAME}" "${NAME}-mail" > /dev/null 2>&1 ; docker network rm "${NAME}-net" > /dev/null 2>&1 +rm -rf "${ROOT}/demo-app/${TAG}" +[ "${2:-}" = --image ] && docker rmi "${NAME}" > /dev/null 2>&1 +echo "The demo of Rails ${LINE} is removed." diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..660130a --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +node_modules/ +.claude/ +tests/reports/*.json +tests/reports/*.html +tests/reports/*.pdf +screenshots/ +videos/ +traces/ +test-results/ +*.har +*.zip +*.log +.DS_Store +demo-app/ diff --git a/README.md b/README.md index 84cf57c..33236b1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,269 @@ -# Ruby on Rails steps +# rails-steps -Cucumber step definitions for Ruby on Rails web apps, for webship-js +

Ruby on Rails logo: this pack supports Ruby on Rails

+ +Cucumber step definitions for Ruby on Rails apps, for [webship-js](https://webship.co/docs/webship-js/2.0.x), a BDD +browser automation harness built on Playwright and Cucumber-js. + +A Rails app is built from the same parts again and again: a scaffold's resources, the authentication generator's +sign-in and password reset, Turbo's forms and confirms, its CSRF guard and its health check. The steps follow those +conventions, so a scenario reads the same for any app made the Rails way, and they keep every password, session cookie, +secret_key_base and reset token out of their words, their messages, their failures and the reports: + +- **users:** made in the app through its own console (`bin/rails runner -`, the code on its input, never on a command + line), with a random password kept in memory, and removed with their sessions at the scenario's end; +- **signing in and out:** the generator's sign-in page, a wrong password refused, the app's "Sign out", and the check + that a page then asks to sign in again; +- **a scaffold's resources:** made, edited and destroyed through their pages (Turbo's confirm answered, confirm or + cancel), listed or not, the notices the app sets, and the errors that refuse a record; +- **the app's guards:** its session cookies' flags for the page's scheme, a form posted without its CSRF token refused, + its health check; +- **a password reset by mail:** asked for, the mail read from the app's mail catcher (never its log), the link followed + and a new password chosen, the used link refused; +- **in development:** the app's error page for a missing record, without a secret on it; +- **no request outside the app's address.** + +No step phrase names the platform: a scenario reads `When I create a "note" in the web application with:` and +`Then the web application should have mailed "reader@example.com" a password reset link`. + +## Requirements + +- Node.js 24 or newer. +- webship-js 2.0.20 or newer. +- A Rails app with the authentication generator's sign-in and password reset, and a console the suite can run Ruby in + (`bin/rails runner -`). Rails 8.1.4.1 and 8.0.5.2 are the two lines this pack is proven on, both on Ruby 4.0.10. +- For the password-reset steps, a mail catcher with Mailpit's API that the app's mail goes to. + +## Install + +```bash +npm install --save-dev @webship-js/rails-steps +``` + +List its step definitions in `cucumber.js`, after webship-js's own, and tell it the app's console and mail catcher: + +```js +require: [ + 'node_modules/webship-js/tests/step-definitions/**/*.js', + 'node_modules/@webship-js/rails-steps/tests/step-definitions/**/*.js', + 'tests/step-definitions/**/*.js', +], +worldParameters: { + launchUrl: 'https://notes.ddev.site', + webApp: { + console: ['ddev', 'exec', 'bin/rails', 'runner', '-'], // or ['docker', 'exec', '-i', '', 'bin/rails', 'runner', '-'] + mailUrl: 'https://notes.ddev.site:8026', // Mailpit + secretKeyBase: process.env.WEB_APP_SECRET_KEY_BASE, // only to keep it out of the output + }, +}, +``` + +## Quick start + +```gherkin +Feature: Notes + Background: + Given the web application has a user "editor@example.com" + And I am signed in to the web application as "editor@example.com" + + Scenario: Made, refused, destroyed after a confirm + When I create a "note" in the web application with: + | Title | The quiet garden | + Then the web application should say "Note was successfully created." + When I try to create a "note" in the web application with: + | Title | | + Then the web application should show the error "Title can't be blank" + When I destroy the "note" "The quiet garden" in the web application and confirm + Then the web application should not list the "note" "The quiet garden" + And the web application should have sent no request outside its address +``` + +## From nothing to a green run + +```bash +git clone https://github.com/webship/rails-steps && cd rails-steps +npm ci && npx playwright install chromium +export RAILS_DEMO_SECRET_KEY_BASE="$(openssl rand -hex 64)" +bash .github/scripts/build-demo.sh 8.1.4.1 # http://127.0.0.1:8780, its mail at :8790 (8.0.5.2: :8781, :8791) +npx cucumber-js # LINE=8.0.5.2 for the other line +npm run test:must-fail +bash .github/scripts/remove-demo.sh 8.1.4.1 +``` + +### The demo app + +It is made at the build, never shipped: `demo/rails-demo-app.sh` runs `rails new` (SQLite; no Kamal, Thruster, Docker, +CI, RuboCop or Brakeman files), a scaffold of notes (a title and a body), and the authentication generator, on the +official Ruby image by its digest: + +| Rails line | Ruby | Image | +| --- | --- | --- | +| 8.1.4.1 | 4.0.10 | `docker.io/library/ruby@sha256:5ac6b9f959a3356af5fc4f6a80a30106d99fd51785633f8a365be73cbe84e199` (4.0.10-slim-bookworm) | +| 8.0.5.2 | 4.0.10 | the same | + +Rails 8.0 was to run on Ruby 3.4.13 (`sha256:b9ca1b2b1f19a50b4f496c5c3af813151dd03a19ee053c157c4ee569c1e581bb`), so the +two lines covered two Rubies; its image's build tools could not be fetched (Debian's mirror stalled, twice), so both +lines run on Ruby 4.0.10, where both were proven. + +Then a few additions of ours, each because a step or a person needs it: + +- `root "notes#index"`: the generator sends a signed-in person to `root_url`, which `rails new` has none of; +- a title presence validation on a note; +- a "Sign out" button: the generator has the route (`DELETE /session`) and no control for it; +- a confirm on "Destroy this note" (Turbo's `data-turbo-confirm`, the browser's own dialog); +- the mail's links at the app's address (`APP_HOST`, `APP_PROTOCOL`), its mail to a mail catcher (`SMTP_HOST`); +- cookies Secure on https and plain on http: a middleware flags them on a secure request only (a TLS proxy's + `X-Forwarded-Proto` counts, from a trusted proxy). Not `force_ssl`: it redirects to https, and makes the session + cookie Secure on every request, so a plain-http port would keep no session (every form then failed its CSRF check, + 422). Proven on the demo: + + ``` + $ curl -s -D - -o /dev/null http://127.0.0.1:8780/session/new | grep -i set-cookie + set-cookie: _notes_session=…; path=/; httponly; samesite=lax + $ curl -s -D - -o /dev/null -H 'X-Forwarded-Proto: https' http://127.0.0.1:8780/session/new | grep -i set-cookie + set-cookie: _notes_session=…; path=/; httponly; samesite=lax; secure + ``` + + The step `Then the web application's session cookies should be safe for its scheme` checks it for the page's own scheme; +- secret_key_base from a file only its user can read (`SECRET_KEY_BASE_FILE`), never from a command line; +- the generator's rate limits on signing in (both lines) and on reset requests (8.1; 8.0's generator has none), 10 in 3 + minutes per address, from the environment (`SIGN_IN_RATE_LIMIT`, 10 when unset): **only this demo and the Webship + Workspace's development build set 500**, as a suite signs in more often than a person. A production app keeps the + generator's 10: never ship 500 to a public site; +- three made-up notes of ours as seeds ("The harbour walk", "The lighthouse steps", "The market list"). + +The demo runs in **development**, capped at 512 MB, beside a mail catcher (Mailpit 1.34.1 by digest, MIT, capped at +128 MB). Development, because one step needs it: the app's error page for a missing record (`@development`; a production +app answers a plain 404, and the step's scenario is left out with `WEB_APP_ENV=production`). Every other step runs on a +production app too. + +### What the suite tests + +Three features, seven scenarios: signing in and out (the cookies' flags, a wrong password, a password reset by mail +used once), notes (made, edited, a destroy cancelled then confirmed, a note refused without its title), and the app (its +health check, forms refused without their CSRF token, its development error page). Eleven must-fail scenarios check that +each assertion fails when it should, with its message and a hint (one against an address nothing answers); the check +then scans their output, their JSON and HTML reports and every file the runs left for the app's secret_key_base, a +session cookie's value and a reset token (`/passwords/`), and fails on any trace or HAR file. + +## What needs the app's console + +The console (`worldParameters.webApp.console`: a command that runs the Ruby on its input in the app, +`bin/rails runner -`) is how the pack makes and removes what a scenario needs without a back door into the app: + +- `Given the web application has a user ""`, and so every step that signs that user in or resets its password; +- the clean-up at a scenario's end: the users it made (with their sessions) and the records it made through + `When I create a "" …`. + +Every other step needs only the app's address (and, for the reset mail, its mail catcher). Against an outside Rails app, +give the pack a console that reaches it (`ddev exec`, `docker exec -i `, `kubectl exec -i deploy/ --`, +each followed by `bin/rails runner -`). The Webship Workspace's core runs a suite off DDEV in a tests container of its +own that cannot reach an app's container yet ([webship/workspace#1056](https://github.com/webship/workspace/issues/1056)): +run such a suite from the host there. + +## Settings + +`worldParameters.webApp` in `cucumber.js`: + +| Setting | Default | What it is | +| --- | --- | --- | +| `console` | none | The words of a command that runs the Ruby on its input in the app (`bin/rails runner -`). | +| `mailUrl` | none | The app's mail catcher (Mailpit's API). | +| `secretKeyBase` | none | The app's secret_key_base, from the environment, only to keep it out of the output. | + +## Steps + +22 step definitions; each has five examples in its JSDoc block. + +### `rails-session.steps.js` (5) + +- `Given the web application has a user ""`: removed with its sessions at the scenario's end. +- `Given I am signed in to the web application as ""` +- `When I try to sign in to the web application as "" with a wrong password` +- `When I sign out of the web application` +- `Then I should be signed out of the web application` + +### `rails-resources.steps.js` (8) + +- `When I create a "" in the web application with:` (a table of `| label | value |`): removed at the scenario's end. +- `When I try to create a "" in the web application with:`: refused (422); the browser's console line for that + answer is allowed in this step only, for that path and status. +- `When I edit the "" "" in the web application with:` +- `When I destroy the "" "" in the web application and confirm` / `and cancel` +- `Then the web application should list the "" ""` / `should not list` +- `Then the web application should say ""` +- `Then the web application should show the error ""` + +### `rails-app.steps.js` (9) + +- `Then the web application's session cookies should be safe for its scheme`: HttpOnly, SameSite Lax, Secure exactly on https. +- `Then the web application should refuse a " " without its CSRF token` +- `Then the web application's health check should answer 200` +- `When I ask the web application to reset the password of ""`: only for a user the scenario made. +- `Then the web application should have mailed "" a password reset link`: from the mail catcher; the mail removed at + the scenario's end. +- `When I follow the password reset link and choose a new password` +- `Then the password reset link should be refused by the web application` +- `Then the web application should show its error page for a missing ""` (`@development`) +- `Then the web application should have sent no request outside its address` + +## Secrets + +A user's password is made for the scenario and lives in memory; it reaches the app inside the Ruby its console reads +on its input, and the page through the password field set by its id, never through a step's words or a command line. +The app's secret_key_base is only known to the pack to take it out of any text. + +A password-reset token sits in a link's path, `/passwords//edit`, and a page there carries it in its address: +in the browser's messages, and in the `Page:` line webship-js adds to a failure. The pack masks the path and every +cookie value in its failures, in its messages and in webship-js's list of the browser's errors (until webship-js does +it: [webship/webship-js#707](https://github.com/webship/webship-js/issues/707)), and never turns on a trace or a HAR. + +## What a run leaves behind + +Nothing a later run sees: every user (with its sessions), record and mail a scenario makes is removed at its end, even +when it fails. The app's seeds stay as they were. + +## The console + +The suite runs in webship-js's `fail` mode with nothing let through for the whole suite. Two answers of the app show in +the browser's console at known moments, and the step of each moment allows only its own, then counts it in the report: + +- a refused form (422): "Failed to load resource: … 422 (Unprocessable Content) @
/", in the step + that sends it; +- the development error page (404): "Failed to load resource: … 404 … @
//999999999", in its step. + +## Licence of the framework + +Ruby on Rails is MIT. This pack carries no code of Rails: the demo installs it at the build. + +## Phrases shared with other packs + +None. Every phrase says "the web application" ("the web app" is the Flask pack's). Checked before the release against +the 71 published packs and the Jellyfin, Meilisearch, Express, Superset, Flask, Vaultwarden and Gitea packs: no example +or feature step of this pack matches another pack's definition, and no step of theirs matches one of this pack's. + +## Testing this package + +```bash +npm run test:examples # every example of every step matches its own definition only; every feature step one +npm run test:paths # a feature or a scenario named on the command line runs alone +npx cucumber-js --dry-run +``` + +CI, for each line (8.1.4.1 and 8.0.5.2), builds the demo and runs the suite twice and then the must-fail assertions. + +## License + +MIT. + +## Logo + +The logo is Simple Icons' Ruby on Rails icon (`icons/rubyonrails.svg` of simple-icons 16.39.0), in the colour the set +lists for it (`#D30001`); its path is unmodified. Simple Icons gives it no licence of its own and points to the Rails +trademark policy as its guidelines (rubyonrails.org/trademarks), which allows the logo "to say 'we support Ruby on +Rails'": that is its only use here. It is not covered by this package's licence. + +--- + +Rails, Ruby on Rails, and the Rails logo are trademarks of the Rails Foundation. This project is not endorsed by or +affiliated with Rails, the trademark owner, or the Rails Foundation. diff --git a/assets/logo.svg b/assets/logo.svg new file mode 100644 index 0000000..f84fc72 --- /dev/null +++ b/assets/logo.svg @@ -0,0 +1 @@ +Ruby on Rails \ No newline at end of file diff --git a/cucumber.js b/cucumber.js new file mode 100644 index 0000000..4c5b09f --- /dev/null +++ b/cucumber.js @@ -0,0 +1,144 @@ +// A feature file, a scenario (file:line), a folder or a rerun file named on +// the command line of cucumber-js runs alone: `npx cucumber-js +// tests/features/app.feature`. cucumber-js 12 adds the paths of the +// command line to the `paths` of this file instead of using them alone, so +// `paths` is left empty when the command line names any, as in webship-js. +const OPTIONS_WITH_A_VALUE = new Set([ + '-c', '--config', '-f', '--format', '--format-options', '--i18n-keywords', + '-i', '--import', '-l', '--loader', '--language', '--name', '--order', + '-p', '--profile', '--parallel', '--plugin', '--plugin-options', + '-r', '--require', '--require-module', '--retry', '--retry-tag-filter', + '--shard', '-t', '--tags', '--world-parameters', +]); + +function commandLinePaths() { + // Only when cucumber-js itself runs, not when another script reads this file. + if (!/cucumber(-js|\.js)?$/.test(String(process.argv[1] || ''))) return []; + const args = process.argv.slice(2); + const paths = []; + for (let i = 0; i < args.length; i += 1) { + if (args[i].startsWith('-')) { + if (OPTIONS_WITH_A_VALUE.has(args[i])) i += 1; + } else { + paths.push(args[i]); + } + } + return paths; +} + +// The demo of this repository's own suite, made by .github/scripts/build-demo.sh : an app of the framework's +// line made at the build (demo/rails-demo-app.sh) on the official Ruby image by its digest, in development mode, capped +// at 512 MB, its mail to a mail catcher beside it. LINE picks the line (8.1.4.1 by default, the latest; or 8.0.5.2): +// 8.1.4.1 http://127.0.0.1:8780 (its mail at http://127.0.0.1:8790) +// 8.0.5.2 http://127.0.0.1:8781 (its mail at http://127.0.0.1:8791) +// LAUNCH_URL, WEB_APP_MAIL_URL and WEB_APP_CONSOLE point the suite at another app (the one the Webship Workspace's +// plugin builds). +const line = process.env.LINE === '8.0.5.2' ? '8.0.5.2' : '8.1.4.1'; +const launchUrl = process.env.LAUNCH_URL || `http://127.0.0.1:${line === '8.0.5.2' ? 8781 : 8780}`; +const mailUrl = process.env.WEB_APP_MAIL_URL || `http://127.0.0.1:${line === '8.0.5.2' ? 8791 : 8790}`; +// The app's console: a command that runs the Ruby it reads on its input in the app (bin/rails runner -). JSON words. +const console_ = process.env.WEB_APP_CONSOLE ? JSON.parse(process.env.WEB_APP_CONSOLE) + : ['docker', 'exec', '-i', `rails-steps-${line.replace(/\./g, '-')}`, 'bin/rails', 'runner', '-']; + +// The default lane: no work in progress, no assertion that must fail (tests/check-must-fail.js runs them), the +// scenarios of the line only (@line-8-1, @line-8-0), and those that need the development error page only where it is +// (WEB_APP_ENV=production leaves them out). +const lane = ['not @wip', 'not @must-fail', line === '8.0.5.2' ? 'not @line-8-1' : 'not @line-8-0', + ...(process.env.WEB_APP_ENV === 'production' ? ['not @development'] : [])].join(' and '); + +// No browser error is let through for the whole suite: the web client's own errors are allowed by its steps, each only +// at its own moment, and counted in the report. +const IGNORED = []; + +module.exports = { + default: { + // The step timeout is webship-js's (45 s, set when it loads): WEBSHIP_STEP_TIMEOUT= changes it; a `timeout` key here is ignored. + requireModule: ['tsx/cjs'], + require: [ + 'node_modules/webship-js/tests/step-definitions/**/*.js', // Webship-js core step definitions (auto HTML report on exit; disable: WEBSHIP_REPORT_DISABLE=1). + 'tests/step-definitions/**/*.js', // The step definitions of this pack. + ], + // FEATURES=tests/features/a.feature,tests/features/b.feature runs a subset too. + paths: process.env.FEATURES ? process.env.FEATURES.split(',') : (commandLinePaths().length ? [] : ['tests/features/**/*.feature']), + // CUCUMBER_TAGS=@critical runs another lane. + tags: process.env.CUCUMBER_TAGS || lane, + format: [ + '@cucumber/pretty-formatter', + // REPORT_NAME=must-fail keeps the report of another run (tests/check-must-fail.js) apart. + `json:tests/reports/${process.env.REPORT_NAME || 'cucumber_report'}.json`, + ], + formatOptions: { + // Colours follow the terminal (GitHub Actions counts as one); FORCE_COLOR=1 + // or FORCE_COLOR=0 sets them. cucumber-js 12 deprecated `colorsEnabled`. + theme: { + 'feature keyword': ['bold', 'blue'], + 'feature name': ['blue', 'underline'], + 'feature description': ['blueBright'], + 'scenario keyword': ['bold', 'magenta'], + 'scenario name': ['magenta', 'underline'], + 'step keyword': ['bold', 'green'], + 'step text': ['greenBright', 'italic'], + }, + }, + worldParameters: { + launchUrl, + // The settings of this pack (the README lists them): the app's console, its mail catcher, its secret (only to keep + // it out of the output), from the environment, never in a feature. + webApp: { + console: console_, + mailUrl, + secretKeyBase: process.env.RAILS_DEMO_SECRET_KEY_BASE || process.env.WEB_APP_SECRET_KEY_BASE || '', + }, + // No Playwright trace and no HAR file: a password-reset link carries its token in its address, and a trace or a HAR + // would keep it, with every cookie. The pack never turns either on. + // Video of the browser: 'off', 'on', 'on-failure' or 'tag' (scenarios tagged @video; @no-video opts out). + video: { mode: process.env.WEBSHIP_VIDEO || 'off', dir: './videos', size: { width: 1280, height: 720 }, filenamePattern: '{datetime}.{feature_file}.{scenario}.{status}.{ext}' }, + // JavaScript errors the page raises: 'warn' reports them, 'fail' fails the scenario, 'off' ignores them; + // @js-fail, @js-warn and @js-off per scenario. This pack's own suite fails on any browser error but the refusals + // its scenarios load on purpose (IGNORED, above). + javascript: { + mode: process.env.WEBSHIP_JS_ERROR_MODE || 'fail', + levels: ['error'], + ignore: IGNORED.length ? IGNORED.join('|') : null, + beforeScenario: false, + afterScenario: true, + }, + // The waits webship-js adds around each page, scenario and step (milliseconds). The steps of this pack wait on + // the app itself (the page that answers a form). + minWaitTime: { + page: 0, + before_scenario: 0, + after_scenario: 0, + before_step: 0, + after_step: 0, + }, + selectors: { + css: {}, + xpath: {}, + filesPath: './tests/selectors/', + files: [], + offset: 60, + breakpoints: { + xs: { width: 375, height: 667 }, + sm: { width: 576, height: 800 }, + md: { width: 768, height: 1024 }, + lg: { width: 992, height: 768 }, + xl: { width: 1200, height: 900, default: true }, + xxl: { width: 1400, height: 900 }, + xxxl: { width: 1920, height: 1080 }, + }, + }, + screenshot: { + dir: './screenshots', + purge: false, + onFailed: true, + onEveryStep: false, + alwaysFullscreen: false, + failedPrefix: 'failed_', + filenamePattern: '{datetime}.{feature_file}.feature_{step_line}.{ext}', + filenamePatternFailed: '{failed_prefix}{datetime}.{feature_file}.feature_{step_line}.{ext}', + infoTypes: '', + }, + }, + }, +}; diff --git a/demo/Dockerfile b/demo/Dockerfile new file mode 100644 index 0000000..d1ecd67 --- /dev/null +++ b/demo/Dockerfile @@ -0,0 +1,12 @@ +# The demo of this pack's own suite: the official Ruby image by its digest, the build tools the gems need, and the demo +# app made in the image by demo/rails-demo-app.sh (nothing of it ships in the package). +ARG RUBY_IMAGE +FROM ${RUBY_IMAGE} +ARG RAILS_VERSION +RUN apt-get update && apt-get install -y --no-install-recommends build-essential git libyaml-dev pkg-config \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app +COPY rails-demo-app.sh /usr/local/bin/rails-demo-app.sh +RUN bash /usr/local/bin/rails-demo-app.sh "${RAILS_VERSION}" notes +WORKDIR /app/notes +CMD ["bin/rails", "server", "-b", "0.0.0.0", "-p", "3000"] diff --git a/demo/rails-demo-app.sh b/demo/rails-demo-app.sh new file mode 100755 index 0000000..dc6b946 --- /dev/null +++ b/demo/rails-demo-app.sh @@ -0,0 +1,119 @@ +#!/usr/bin/env bash +# The demo app, made at build time (nothing of it ships): `rails new`, a scaffold of notes, Rails' own authentication +# generator, then a few additions of ours, each said below. Run in the official Ruby image, in an empty folder. +# bash rails-demo-app.sh [] +# +# What it reads at its start, from the environment (never a command line): +# SECRET_KEY_BASE_FILE a file (0600) holding secret_key_base +# APP_HOST, APP_PROTOCOL the address it is served at (the mail's links; the hosts it answers) +# SMTP_HOST, SMTP_PORT the mail catcher its mail goes to +set -euo pipefail +RAILS_VERSION="$1" ; APP="${2:-notes}" + +gem list -i rails -v "${RAILS_VERSION}" > /dev/null || gem install rails -v "${RAILS_VERSION}" --no-document +rails "_${RAILS_VERSION}_" new "${APP}" --database=sqlite3 --skip-kamal --skip-thruster --skip-docker --skip-git \ + --skip-ci --skip-rubocop --skip-brakeman --quiet +cd "${APP}" +bin/rails generate scaffold Note title:string body:text --quiet +bin/rails generate authentication --quiet + +ruby - <<'RUBY' +def edit(path) + text = File.read(path) + changed = yield(text.dup) + raise "#{path}: nothing changed" if changed == text + File.write(path, changed) +end + +# The page after signing in: the generator sends a person to root_url, which `rails new` has none of. +edit("config/routes.rb") { |t| t.sub(/^Rails\.application\.routes\.draw do\n/) { |m| m + " root \"notes#index\"\n" } } + +# A note needs a title. +edit("app/models/note.rb") { |t| t.sub(/^class Note < ApplicationRecord\n/) { |m| m + " validates :title, presence: true\n" } } + +# Signing out: the generator has the route (DELETE /session) and no control for it. +edit("app/views/layouts/application.html.erb") do |t| + t.sub(/^(\s*)<%= yield %>/) { "#{$1}<% if authenticated? %><%= button_to \"Sign out\", session_path, method: :delete %><% end %>\n#{$1}<%= yield %>" } +end + +# The generator's rate limits (10 sign-ins, 10 reset requests in 3 minutes, per address) from the environment, 10 by +# default: a suite signs in more often than a person (SIGN_IN_RATE_LIMIT, set by the demo and the plugin's testing). +# (Rails 8.0's PasswordsController has no rate limit of its own: only the sessions' is required.) +edit("app/controllers/sessions_controller.rb") { |t| t.gsub(/rate_limit to: 10,/, 'rate_limit to: ENV.fetch("SIGN_IN_RATE_LIMIT", "10").to_i,') } +passwords = File.read("app/controllers/passwords_controller.rb") +if passwords.include?("rate_limit to: 10,") + edit("app/controllers/passwords_controller.rb") { |t| t.gsub(/rate_limit to: 10,/, 'rate_limit to: ENV.fetch("SIGN_IN_RATE_LIMIT", "10").to_i,') } +end + +# Destroying asks first (Turbo's confirm: the browser's own dialog). +edit("app/views/notes/show.html.erb") do |t| + t.sub(/<%= button_to "Destroy this note", @note, method: :delete %>/, + '<%= button_to "Destroy this note", @note, method: :delete, form: { data: { turbo_confirm: "Destroy this note?" } } %>') +end + +# Where it is served, its mail and its secret, from the environment, in every environment. +File.write("config/initializers/webship_demo.rb", <<~INIT) + # The demo app's additions (rails-demo-app.sh), read from the environment at its start. + + # Secure on the cookies of a secure request only (what ActionDispatch::SSL does for cookies, without its redirect). + class SecureCookiesOnHttps + def initialize(app) + @app = app + end + + def call(env) + status, headers, body = @app.call(env) + if ActionDispatch::Request.new(env).ssl? && (cookies = headers["set-cookie"]) + list = cookies.is_a?(Array) ? cookies : cookies.split("\\n") + headers["set-cookie"] = list.map { |c| c.match?(/;\\s*secure\\s*(;|$)/i) ? c : "\#{c}; secure" } + end + [status, headers, body] + end + end + + Rails.application.configure do + host = ENV["APP_HOST"].presence + protocol = ENV.fetch("APP_PROTOCOL", "http") + # The hosts it answers: its address, and this machine's own. + config.hosts.concat([host, "localhost", "127.0.0.1"].compact) if host + + # The links in its mail point at its address. + config.action_mailer.default_url_options = { host: host || "localhost", protocol: protocol } + if ENV["SMTP_HOST"].present? + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { address: ENV["SMTP_HOST"], port: ENV.fetch("SMTP_PORT", "1025").to_i } + config.action_mailer.perform_deliveries = true + config.action_mailer.raise_delivery_errors = true + end + + # Cookies carry Secure on https (a TLS proxy's X-Forwarded-Proto counts, from a trusted proxy) and stay plain on + # http, where a Secure cookie would never come back. Not force_ssl: it redirects to https, and makes the session + # cookie Secure on every request, so a plain-http port would keep no session. + config.force_ssl = false + config.assume_ssl = false + config.middleware.insert_before ActionDispatch::Cookies, SecureCookiesOnHttps + + # secret_key_base from a file only its user can read, never from a command line. + if ENV["SECRET_KEY_BASE_FILE"].present? + config.secret_key_base = File.read(ENV["SECRET_KEY_BASE_FILE"]).strip + end + end +INIT + +# Three notes of ours, made up for the demo. +File.write("db/seeds.rb", <<~SEEDS) + # Made-up notes of the demo (rails-demo-app.sh). + [ + ["The harbour walk", "Morning light on the water, and a note to come back at dusk."], + ["The lighthouse steps", "Ninety-one steps, counted twice on the way down."], + ["The market list", "Bread, pears, a jar of honey, and string for the parcels."], + ].each { |title, body| Note.find_or_create_by!(title: title) { |n| n.body = body } } +SEEDS +RUBY + +# Rails 8's production settings would redirect every request to https and send HSTS: the initializer above says it +# for every environment, so the lines of production.rb that say otherwise go. +sed -i -E 's/^(\s*config\.(assume_ssl|force_ssl) = true)/# \1 (rails-demo-app.sh: see config\/initializers\/webship_demo.rb)/' config/environments/production.rb +bin/rails db:prepare > /dev/null +bin/rails db:seed +echo "The demo app ${APP}: Rails $(bin/rails -v | awk '{print $2}') on Ruby ${RUBY_VERSION}." diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..062629c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3080 @@ +{ + "name": "@webship-js/rails-steps", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@webship-js/rails-steps", + "version": "2.0.0", + "license": "MIT", + "devDependencies": { + "tsx": "^4.23.0", + "webship-js": "^2.0.20" + }, + "engines": { + "node": ">= 24.0" + }, + "peerDependencies": { + "webship-js": "^2.0.20" + } + }, + "node_modules/@axe-core/playwright": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/@axe-core/playwright/-/playwright-4.14.1.tgz", + "integrity": "sha512-cSN1ijrWLnlOof22sPN4RtWGSoPpt7GzOVyOKomyhnPsy1fPNoRdBiJAUziuCRs8KoK50kKufiMUFt7itAuwOg==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "axe-core": "~4.14.1" + }, + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "playwright-core": ">= 1.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.17.tgz", + "integrity": "sha512-IdlVpcDeoDATtN2cfmnVk0A4XJKhu7SlpGuSaiOFdko09YC1MD07WokWUSEdw5R2o4o8VObX2LzViQW6VXnzkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.17", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.17.tgz", + "integrity": "sha512-AG+olLB+teKhkQ2WYJeaZqJwNLjtWTz1waQIP/tEYITzVzpdHLP7IXx2c/bH2JTsNCgvWlkqdCv91xcb8lul8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@cucumber/ci-environment": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/ci-environment/-/ci-environment-13.0.0.tgz", + "integrity": "sha512-cs+3NzfNkGbcmHPddjEv4TKFiBpZRQ6WJEEufB9mw+ExS22V/4R/zpDSEG+fsJ/iSNCd6A2sATdY8PFOyY3YnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@cucumber/cucumber": { + "version": "12.9.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber/-/cucumber-12.9.0.tgz", + "integrity": "sha512-QbgEo/DcKFMRGL+yULh8Kw6peEfdPJjhYjpKp0dYc+6Dv1Bmp6hvxIdTi2CIinYBCXhvCZzNO1Ct/n6Dk1yAtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cucumber/ci-environment": "13.0.0", + "@cucumber/cucumber-expressions": "19.0.0", + "@cucumber/gherkin": "38.0.0", + "@cucumber/gherkin-streams": "6.0.0", + "@cucumber/gherkin-utils": "11.0.0", + "@cucumber/html-formatter": "23.1.0", + "@cucumber/junit-xml-formatter": "0.13.3", + "@cucumber/message-streams": "4.1.1", + "@cucumber/messages": "32.3.1", + "@cucumber/pretty-formatter": "1.0.1", + "@cucumber/tag-expressions": "9.1.0", + "assertion-error-formatter": "^3.0.0", + "capital-case": "^1.0.4", + "chalk": "^4.1.2", + "cli-table3": "0.6.5", + "commander": "^14.0.0", + "debug": "^4.3.4", + "error-stack-parser": "^2.1.4", + "figures": "^3.2.0", + "glob": "^13.0.0", + "has-ansi": "^4.0.1", + "indent-string": "^4.0.0", + "is-installed-globally": "^0.4.0", + "is-stream": "^2.0.0", + "knuth-shuffle-seeded": "^1.0.6", + "lodash.merge": "^4.6.2", + "lodash.mergewith": "^4.6.2", + "luxon": "3.7.2", + "mkdirp": "^3.0.0", + "mz": "^2.7.0", + "progress": "^2.0.3", + "read-package-up": "^12.0.0", + "semver": "7.7.4", + "string-argv": "0.3.1", + "supports-color": "^8.1.1", + "type-fest": "^4.41.0", + "util-arity": "^1.1.0", + "yaml": "^2.2.2", + "yup": "1.7.1" + }, + "bin": { + "cucumber-js": "bin/cucumber.js" + }, + "engines": { + "node": "20 || 22 || >=24" + }, + "funding": { + "url": "https://opencollective.com/cucumber" + } + }, + "node_modules/@cucumber/cucumber-expressions": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/cucumber-expressions/-/cucumber-expressions-19.0.0.tgz", + "integrity": "sha512-4FKoOQh2Uf6F6/Ln+1OxuK8LkTg6PyAqekhf2Ix8zqV2M54sH+m7XNJNLhOFOAW/t9nxzRbw2CcvXbCLjcvHZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "regexp-match-indices": "1.0.2" + } + }, + "node_modules/@cucumber/cucumber/node_modules/@cucumber/messages": { + "version": "32.3.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-32.3.1.tgz", + "integrity": "sha512-yNQq1KoXRYaEKrWMFmpUQX7TdeQuU9jeGgJAZ3dArTsC/T4NpJ6DnqaJIIgwPnz/wtQIQTNX7/h0rOuF5xY4qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2" + } + }, + "node_modules/@cucumber/gherkin": { + "version": "38.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin/-/gherkin-38.0.0.tgz", + "integrity": "sha512-duEXK+KDfQUzu3vsSzXjkxQ2tirF5PRsc1Xrts6THKHJO6mjw4RjM8RV+vliuDasmhhrmdLcOcM7d9nurNTJKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cucumber/messages": ">=31.0.0 <33" + } + }, + "node_modules/@cucumber/gherkin-streams": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-streams/-/gherkin-streams-6.0.0.tgz", + "integrity": "sha512-HLSHMmdDH0vCr7vsVEURcDA4WwnRLdjkhqr6a4HQ3i4RFK1wiDGPjBGVdGJLyuXuRdJpJbFc6QxHvT8pU4t6jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "14.0.0", + "source-map-support": "0.5.21" + }, + "bin": { + "gherkin-javascript": "bin/gherkin" + }, + "peerDependencies": { + "@cucumber/gherkin": ">=22.0.0", + "@cucumber/message-streams": ">=4.0.0", + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/gherkin-streams/node_modules/commander": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.0.tgz", + "integrity": "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@cucumber/gherkin-utils": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/gherkin-utils/-/gherkin-utils-11.0.0.tgz", + "integrity": "sha512-LJ+s4+TepHTgdKWDR4zbPyT7rQjmYIcukTwNbwNwgqr6i8Gjcmzf6NmtbYDA19m1ZFg6kWbFsmHnj37ZuX+kZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cucumber/gherkin": "^38.0.0", + "@cucumber/messages": "^32.0.0", + "@teppeis/multimaps": "3.0.0", + "commander": "14.0.2", + "source-map-support": "^0.5.21" + }, + "bin": { + "gherkin-utils": "bin/gherkin-utils" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/@cucumber/messages": { + "version": "32.3.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-32.3.1.tgz", + "integrity": "sha512-yNQq1KoXRYaEKrWMFmpUQX7TdeQuU9jeGgJAZ3dArTsC/T4NpJ6DnqaJIIgwPnz/wtQIQTNX7/h0rOuF5xY4qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2" + } + }, + "node_modules/@cucumber/gherkin-utils/node_modules/commander": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/@cucumber/gherkin/node_modules/@cucumber/messages": { + "version": "32.3.1", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-32.3.1.tgz", + "integrity": "sha512-yNQq1KoXRYaEKrWMFmpUQX7TdeQuU9jeGgJAZ3dArTsC/T4NpJ6DnqaJIIgwPnz/wtQIQTNX7/h0rOuF5xY4qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "class-transformer": "0.5.1", + "reflect-metadata": "0.2.2" + } + }, + "node_modules/@cucumber/html-formatter": { + "version": "23.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/html-formatter/-/html-formatter-23.1.0.tgz", + "integrity": "sha512-DcCSFoGs6jbwzXPgX1CwgJKEE+ZMcIEzq/0Memg0o24maNn9NJizBFHmoFWG4iv/OxHza+mvc+56cTHetfHndw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@cucumber/messages": ">=18" + } + }, + "node_modules/@cucumber/junit-xml-formatter": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/@cucumber/junit-xml-formatter/-/junit-xml-formatter-0.13.3.tgz", + "integrity": "sha512-w9ujOxiuKDtU6fLzJz+wp4Sgp5Xu6ba7ls00LHJccVmQU0Ba7zs+AHnv3iIgPjKZAQe1w8x93dr8Gaubh7Vqkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cucumber/query": "^15.0.1", + "@teppeis/multimaps": "^3.0.0", + "luxon": "^3.5.0", + "xmlbuilder": "^15.1.1" + }, + "peerDependencies": { + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/message-streams": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@cucumber/message-streams/-/message-streams-4.1.1.tgz", + "integrity": "sha512-QCAntLajesWMyX+mZKrj63YghVAts7yKFlZe46XprLbdJZN0ddB+f/Mr9OnyWKC2DHhJ18jzCfKIFCaqpAmUxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime": "^3.0.0" + }, + "peerDependencies": { + "@cucumber/messages": ">=17.1.1" + } + }, + "node_modules/@cucumber/messages": { + "version": "35.0.0", + "resolved": "https://registry.npmjs.org/@cucumber/messages/-/messages-35.0.0.tgz", + "integrity": "sha512-lubB5srgXxXwz9uVIJXdk4dm+CdKj7qfrGNHqFvlBtt4wrUb9413KBOJUpdUWTasJmQe9pYAa2rYNIl3yfW4Ag==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@cucumber/pretty-formatter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/pretty-formatter/-/pretty-formatter-1.0.1.tgz", + "integrity": "sha512-A1lU4VVP0aUWdOTmpdzvXOyEYuPtBDI0xYwYJnmoMDplzxMdhcHk86lyyvYDoMoPzzq6OkOE3isuosvUU4X7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^5.0.0", + "cli-table3": "^0.6.0", + "figures": "^3.2.0", + "ts-dedent": "^2.0.0" + }, + "peerDependencies": { + "@cucumber/cucumber": ">=7.0.0", + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/query": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/@cucumber/query/-/query-15.0.1.tgz", + "integrity": "sha512-FMfT3orJblRsOxvU2doECBvQmauizYlj+5JsM8atAKKPbnQTj7v2/OrnuykvQpfZNBf19DYbRq1e832vllRP/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@teppeis/multimaps": "3.0.0", + "lodash.sortby": "^4.7.0" + }, + "peerDependencies": { + "@cucumber/messages": "*" + } + }, + "node_modules/@cucumber/tag-expressions": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@cucumber/tag-expressions/-/tag-expressions-9.1.0.tgz", + "integrity": "sha512-bvHjcRFZ+J1TqIa9eFNO1wGHqwx4V9ZKV3hYgkuK/VahHx73uiP4rKV3JVrvWSMrwrFvJG6C8aEwnCWSvbyFdQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@teppeis/multimaps": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@teppeis/multimaps/-/multimaps-3.0.0.tgz", + "integrity": "sha512-ID7fosbc50TbT0MK0EG12O+gAP3W3Aa/Pz4DaTtQtEvlc9Odaqi0de+xuZ7Li2GtK4HzEX7IuRWS/JmZLksR3Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/node": { + "version": "24.19.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.4.tgz", + "integrity": "sha512-s04odlR3ksJrLu7QLi+pddkWLD0RmSbcP9KuWn2/ozQKAp/YgwBC/6x9kJj8yAzZnGPfxePm7zm7nysVPCRagw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.4.tgz", + "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@xmldom/xmldom": { + "version": "0.9.12", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.9.12.tgz", + "integrity": "sha512-5AXjrcMClTryPe9LgZrygpB1lj7s0S9E0+W+AHaVKAVyHanafK86iPSvG5xHVSp/jC+VH1UXu0TAEmY279xH7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.6" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/assertion-error-formatter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/assertion-error-formatter/-/assertion-error-formatter-3.0.0.tgz", + "integrity": "sha512-6YyAVLrEze0kQ7CmJfUgrLHb+Y7XghmL2Ie7ijVa2Y9ynP3LV+VDiwFk62Dn0qtqbmY0BT0ss6p1xxpiF2PYbQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "diff": "^4.0.1", + "pad-right": "^0.2.2", + "repeat-string": "^1.6.1" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axe-core": { + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.1.tgz", + "integrity": "sha512-FHfa+lmNjQZfJz1q8wKqIDwC6DExcHt/pkjNQb09a3NPjCKg2rhu5qb2S4r76ASyFNNtuFooJpZe37OgudVGtQ==", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/axios": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.22.0.tgz", + "integrity": "sha512-lVasoE0YvI6ep7jo1dAsukB7lV6VO7uqQZv03ylIc4g7Y2Vamnl0Fim+EBPgp24gUPgqbDXRAMvynAW4KK119g==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.2", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/basic-auth": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/brace-expansion": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.2.tgz", + "integrity": "sha512-ELhY3JEerIBbhgW+rh0/8glkZAaMqn1x3BAvp3yTULSEGozMK/5PT6WTdBgsdvJqwwmv7MAQNOydfYbvK1Vgfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/class-transformer": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", + "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz", + "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + } + }, + "node_modules/corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha512-utCYNzRSQIZNPIcGZdQc92UVJYAhtGAteCFg0yRaFm8f0P+CPtyGyHXJcGXnffjCybUCEx3FQ2G7U3/o9eIkVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/cucumber-html-reporter": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cucumber-html-reporter/-/cucumber-html-reporter-6.0.0.tgz", + "integrity": "sha512-SQUDQr0XEyo1cZmvwDAoWin49cINAYtznx3O02MmQ+bpY5O5NaBLBdrR2HSW7PqWu3+x8v9uq5yaAOXQIw2uJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.4.2", + "find": "^0.3.0", + "fs-extra": "^8.1.0", + "js-base64": "^2.3.2", + "jsonfile": "^5.0.0", + "lodash": "^4.17.11", + "node-emoji": "^1.10.0", + "open": "^6.4.0", + "uuid": "^3.3.3" + } + }, + "node_modules/cucumber-html-reporter/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/cucumber-html-reporter/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cucumber-html-reporter/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/cucumber-html-reporter/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz", + "integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/find/-/find-0.3.0.tgz", + "integrity": "sha512-iSd+O4OEYV/I36Zl8MdYJO0xD82wH528SaCieTVHhclgiYNe9y+yPKSwK+A7/WsmHL1EZ+pYUJBXWTL5qofksw==", + "dev": true, + "license": "MIT", + "dependencies": { + "traverse-chain": "~0.1.0" + } + }, + "node_modules/find-up-simple": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/find-up-simple/-/find-up-simple-1.0.1.tgz", + "integrity": "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.3.tgz", + "integrity": "sha512-toOSoqN6d51Wjf1aOFJYcoVv1aND9rj/CwjLU0Vz40oDuSpWDayCeKe4JpL5NL0WdFvoOOCI3BRo69HahjbR1A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-extra/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "13.0.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.7.tgz", + "integrity": "sha512-wfsFgXQ8A3SEI9XGf7Nl3Y9l7ffSrGh7SUCT7vU/2CzYPep9kjxAn1S40F9OPKxAMGCVl7HtNlJhrCJUeUq83g==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/has-ansi": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-4.0.1.tgz", + "integrity": "sha512-Qr4RtTm30xvEdqUXbSBVWDu+PrTokJOwe/FU+VdfJPk+MXAPoeOzKpRyrDTnZIJwAkQ4oBLTU53nu0HrkF/Z2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-9.0.3.tgz", + "integrity": "sha512-Hc+ghLoSt6QaYZUv0WBiIvmMDZuZZ7oaDvdH8MbfOO4lOsxdXLEvuC6ePoGs9H1X9oCLyq6+NVN0MKqD+ydxyg==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^11.1.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-server": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz", + "integrity": "sha512-+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-auth": "^2.0.1", + "chalk": "^4.1.2", + "corser": "^2.0.1", + "he": "^1.2.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy": "^1.18.1", + "mime": "^1.6.0", + "minimist": "^1.2.6", + "opener": "^1.5.1", + "portfinder": "^1.0.28", + "secure-compare": "3.0.1", + "union": "~0.5.0", + "url-join": "^4.0.1" + }, + "bin": { + "http-server": "bin/http-server" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/http-server/node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/index-to-position": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.2.0.tgz", + "integrity": "sha512-Yg7+ztRkqslMAS2iFaU+Oa4KTSidr63OsFGlOrJoW981kIYO3CGCS3wA95P1mUi/IVSJkn0D479KTJpVpvFNuw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/js-base64": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz", + "integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^0.1.2" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/knuth-shuffle-seeded": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/knuth-shuffle-seeded/-/knuth-shuffle-seeded-1.0.6.tgz", + "integrity": "sha512-9pFH0SplrfyKyojCLxZfMcvkhf5hH0d+UwR9nTVJ/DDQJGuzcXjTwB7TP7sDfehSudlGGaOLblmEWqv04ERVWg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "seed-random": "~2.2.0" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.mergewith": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.2.tgz", + "integrity": "sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.4.tgz", + "integrity": "sha512-B8nJCTi8JuSaDBg0tBdnImV6j5O2CXaqKfdj24ZTCFbyivN8KZ2Z+RL3aHjwJAfLutD9cNnObG4SIgW4gMufiw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/normalize-package-data": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-8.0.0.tgz", + "integrity": "sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "hosted-git-info": "^9.0.0", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.14.0.tgz", + "integrity": "sha512-IVgHNlp/jwQX271+Xzoq9LZNTWXxZK+cEOrGBOBxXNbn7fapnZ+Ts6TVMgNOuAezwG2wdtnMX97tTPK6VEnuOQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/open": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-6.4.0.tgz", + "integrity": "sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "license": "(WTFPL OR MIT)", + "bin": { + "opener": "bin/opener-bin.js" + } + }, + "node_modules/pad-right": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/pad-right/-/pad-right-0.2.2.tgz", + "integrity": "sha512-4cy8M95ioIGolCoMmm2cMntGR1lPLEbOMzOKu8bzjuJP6JpzEMQcDHmh7hHLYGgob+nKe1YHFMaG4V59HQa89g==", + "dev": true, + "license": "MIT", + "dependencies": { + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-json": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/playwright": { + "version": "1.65.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.2.tgz", + "integrity": "sha512-Bfg9lfUnqknFzjWrvz2GMckl656TWYwDHiR+T8MQK1V+Sp1D+ODuxpcsnMQ31BYH+LBiKs6kXRMInesqO8F41w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.65.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.65.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.2.tgz", + "integrity": "sha512-aHu9F46Mx5ha9iiB+VLZMUUtex3PBw4am9MHptc0IXaJhz++6YXsH96eEyThwCwMkIUiB8TdZcwXqnb3xKDzmA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/portfinder": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.38.tgz", + "integrity": "sha512-rEwq/ZHlJIKw++XtLAO8PPuOQA/zaPJOZJ37BVuN97nLpMJeuDVLVGRwbFoBgLudgdTMP2hdRJP++H+8QOA3vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.6", + "debug": "^4.3.6" + }, + "engines": { + "node": ">= 10.12" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/property-expr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz", + "integrity": "sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.17.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.17.1.tgz", + "integrity": "sha512-jd3COkaKVgGUW+ZHyEHCG9bH7RoaaiWuMgzsIBjUMVjLAaWGWpoUAVwljVvBHxRu/2qEHnadLGZrkutYUBPQJA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/read-package-up": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/read-package-up/-/read-package-up-12.0.0.tgz", + "integrity": "sha512-Q5hMVBYur/eQNWDdbF4/Wqqr9Bjvtrw2kjGxxBbKLbx8bVCL8gcArjTy8zDUuLGQicftpMuU0riQNcAsbtOVsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up-simple": "^1.0.1", + "read-pkg": "^10.0.0", + "type-fest": "^5.2.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-package-up/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-10.1.0.tgz", + "integrity": "sha512-I8g2lArQiP78ll51UeMZojewtYgIRCKCWqZEgOO8c/uefTI+XDXvCSXu3+YNUaTNvZzobrL5+SqHjBrByRRTdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/normalize-package-data": "^2.4.4", + "normalize-package-data": "^8.0.0", + "parse-json": "^8.3.0", + "type-fest": "^5.4.4", + "unicorn-magic": "^0.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "dependencies": { + "tagged-tag": "^1.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/regexp-match-indices": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regexp-match-indices/-/regexp-match-indices-1.0.2.tgz", + "integrity": "sha512-DwZuAkt8NF5mKwGGER1EGh2PRqyvhRhhLviH+R8y8dIuaQROlUfXjt4s9ZTXstIsSkptf06BSvwcEmmfheJJWQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "regexp-tree": "^0.1.11" + } + }, + "node_modules/regexp-tree": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dev": true, + "license": "MIT", + "bin": { + "regexp-tree": "bin/regexp-tree" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/secure-compare": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/secure-compare/-/secure-compare-3.0.1.tgz", + "integrity": "sha512-AckIIV90rPDcBcglUwXPF3kg0P0qmPsPXAj6BBEENQE1p5yA1xfmDJzfi1Tappj37Pv2mVbKpL3Z1T+Nn7k1Qw==", + "dev": true, + "license": "MIT" + }, + "node_modules/seed-random": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/seed-random/-/seed-random-2.2.0.tgz", + "integrity": "sha512-34EQV6AAHQGhoc0tn/96a9Fsi6v2xdqe/dMUwljGRaFOzR3EgRmECvD0O8vi8X+/uQ50LGHfkNu/Eue5TPKZkQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.24", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.24.tgz", + "integrity": "sha512-cLS9TtWkIQFyLkJ3/5aFQAOHOSKTlOs/7WDut/XPSdjom1fJhUdkepeJAKXa9Y05+FabHd0sti+Et559vDtkpQ==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==", + "dev": true, + "license": "MIT" + }, + "node_modules/traverse-chain": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/traverse-chain/-/traverse-chain-0.1.0.tgz", + "integrity": "sha512-up6Yvai4PYKhpNp5PkYtx50m3KbwQrqDwbuZP/ItyL64YEWHAvH6Md83LFLV/GRSk/BoUVwwgUzX6SOQSbsfAg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ts-dedent": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz", + "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT" + }, + "node_modules/unicorn-magic": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.1.tgz", + "integrity": "sha512-lzlXPoVB0Uy/FvTaUgX39RbixYiSKoc3JSoSf01+0c2B6FR3qdYIPN7Qjo/AV7n6sqLCk0509cT3LRj1oSZ1+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/union": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/union/-/union-0.5.0.tgz", + "integrity": "sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==", + "dev": true, + "dependencies": { + "qs": "^6.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/url-join": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", + "integrity": "sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==", + "dev": true, + "license": "MIT" + }, + "node_modules/util-arity": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/util-arity/-/util-arity-1.1.0.tgz", + "integrity": "sha512-kkyIsXKwemfSy8ZEoaIz06ApApnWsk5hQO0vLjZS6UkBiGiW++Jsyb8vSBoc0WKlffGoGs5yYy/j5pp8zckrFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/webship-js": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/webship-js/-/webship-js-2.0.20.tgz", + "integrity": "sha512-wJTA2m8A9lv4ws7bLk3BSMhxZeP7W+Kq4Ilr/VYSiIxybbfNenUZqsdIIs2rjuXX9p5NBnH1eni0qtYah+myHQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@axe-core/playwright": "^4.11.3", + "@cucumber/cucumber": "^12", + "@cucumber/pretty-formatter": "~1", + "@types/node": "^24.0.0", + "@xmldom/xmldom": "^0.9.8", + "ajv": "^8.20.0", + "ajv-formats": "^3.0.1", + "axe-core": "^4.11.4", + "axios": "~1", + "cucumber-html-reporter": "^6.0.0", + "http-server": "^14.1.1", + "js-yaml": "^4.1.1", + "playwright": "^1.58.2", + "tsx": "^4.19.2", + "typescript": "~5", + "xpath": "~0.0.34" + }, + "bin": { + "generate-reports": "bin/generate-reports.js", + "init-webship-js": "bin/init-webship.js" + }, + "engines": { + "node": ">= 24.0" + } + }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/xmlbuilder": { + "version": "15.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", + "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0" + } + }, + "node_modules/xpath": { + "version": "0.0.36", + "resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.36.tgz", + "integrity": "sha512-HuqAnJx5YJoDeLub7hhcNoiRvnqqrgoSsI4kLrOtv6XkaUI0zY9ylL4+ULozB35JT1SVMfdexsMqRbTp7bkFGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/yaml": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz", + "integrity": "sha512-3NxN8+78OdzbT7C/WjGsyfPAtJaN3FNDsWxv7Y7mcDsT/oOmgW8BpyQQFFBnvZE3j9Y2Sdz1ULFLezL7Eb2yFw==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yup": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.7.1.tgz", + "integrity": "sha512-GKHFX2nXul2/4Dtfxhozv701jLQHdf6J34YDh2cEkpqoo8le5Mg6/LrdseVLrFarmFygZTlfIhHx/QKfb/QWXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..6d199b3 --- /dev/null +++ b/package.json @@ -0,0 +1,71 @@ +{ + "name": "@webship-js/rails-steps", + "version": "2.0.0", + "description": "Cucumber step definitions for Ruby on Rails apps, a plugin for webship-js (Playwright and Cucumber): steps for the conventions of a Rails app \u2014 users made and removed through the app's own console, signing in and out with its authentication generator, a scaffold's resources made, edited, destroyed with Turbo's confirm and refused with their validation errors, its notices, its session cookies' flags by the page's scheme, its CSRF refusal and health check, a password reset read from a mail catcher and followed, its development error page, and no request outside its address \u2014 every password, cookie, secret and reset token kept out of messages, failures and reports.", + "main": "tests/step-definitions/rails-support.js", + "files": [ + "tests/step-definitions/", + "tests/features/", + "demo/", + "assets/", + "README.md", + "LICENSE" + ], + "scripts": { + "test": "cucumber-js --config cucumber.js", + "test:dry": "cucumber-js --config cucumber.js --dry-run", + "test:examples": "node tests/check-examples.js", + "test:paths": "node tests/check-paths.js", + "test:must-fail": "node tests/check-must-fail.js", + "test:chromium": "BROWSER=chromium cucumber-js --config cucumber.js", + "test:firefox": "BROWSER=firefox cucumber-js --config cucumber.js", + "test:webkit": "BROWSER=webkit cucumber-js --config cucumber.js", + "test:headed": "HEADLESS=false cucumber-js --config cucumber.js", + "generate-reports": "generate-reports", + "test:fast": "SLOW_MO=0 cucumber-js --config cucumber.js", + "demo:build": "bash .github/scripts/build-demo.sh", + "demo:remove": "bash .github/scripts/remove-demo.sh" + }, + "keywords": [ + "webship-js", + "rails", + "ruby-on-rails", + "ruby", + "web-framework", + "authentication", + "turbo", + "cucumber", + "cucumber-js", + "playwright", + "bdd", + "testing", + "e2e", + "gherkin" + ], + "author": "Webship.co", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/webship/rails-steps.git" + }, + "bugs": { + "url": "https://github.com/webship/rails-steps/issues" + }, + "homepage": "https://github.com/webship/rails-steps#readme", + "publishConfig": { + "access": "public" + }, + "engines": { + "node": ">= 24.0" + }, + "peerDependencies": { + "webship-js": "^2.0.20" + }, + "devDependencies": { + "tsx": "^4.23.0", + "webship-js": "^2.0.20" + }, + "overrides": { + "@cucumber/cucumber": "^12" + } +} diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..120f7c4 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,39 @@ +import type { LaunchOptions, BrowserContextOptions } from 'playwright'; + +type BrowserName = 'chromium' | 'firefox' | 'webkit'; + +const browser = (process.env.BROWSER || 'chromium') as BrowserName; + +// No --disable-web-security: the browser keeps the rules a person's has (the same-origin policy, the content +// security policy of the site), so the pages load what a person's browser loads, and refuse what it refuses. +const chromiumArgs: string[] = [ + '--no-sandbox', + '--disable-dev-shm-usage', + '--disable-setuid-sandbox', + '--ignore-certificate-errors', + '--disable-extensions', + '--incognito', + '--disable-infobars', +]; + +interface PlaywrightConfig { + browser: BrowserName; + launchOptions: LaunchOptions; + contextOptions: BrowserContextOptions; +} + +const config: PlaywrightConfig = { + browser, + launchOptions: { + headless: process.env.HEADLESS !== 'false', + // SLOW_MO: milliseconds between browser actions. The steps wait on the page, not on the clock, so 0 works; 800 is comfortable to watch a headed run. + slowMo: parseInt(process.env.SLOW_MO || (process.env.HEADLESS === 'false' ? '800' : '0'), 10), + args: browser === 'chromium' ? chromiumArgs : [], + }, + contextOptions: { + viewport: { width: 1366, height: 900 }, + ignoreHTTPSErrors: true, + }, +}; + +export = config; diff --git a/tests/check-examples.js b/tests/check-examples.js new file mode 100644 index 0000000..a7bab61 --- /dev/null +++ b/tests/check-examples.js @@ -0,0 +1,145 @@ +#!/usr/bin/env node +'use strict'; + +// Checks this step pack's documentation and features against its definitions, +// without a browser: +// +// 1. every step definition in tests/step-definitions carries a JSDoc block +// with at least five single-line "Example #n:" phrasings, +// 2. every example matches its own definition and no other definition loaded +// with it (this pack, webship-js's built-in steps and any other pack +// cucumber.js requires), so a phrasing that drifts or turns ambiguous +// fails the build, +// 3. every step in tests/features and tests/must-fail matches exactly one definition. +// +// Usage: node tests/check-examples.js (npm run test:examples) + +const fs = require('fs'); +const path = require('path'); + +const ROOT = path.resolve(__dirname, '..'); +const PACK_DIR = path.join(ROOT, 'tests', 'step-definitions'); +const FEATURES_DIR = path.join(ROOT, 'tests', 'features'); +// The other step definitions cucumber.js loads next to this pack's own. +const SHARED_DIRS = [ + path.join(ROOT, 'node_modules', 'webship-js', 'tests', 'step-definitions'), +]; +const MIN_EXAMPLES = 5; + +function cucumberExpressionToRegex(expression) { + let s = expression.replace(/[.*+?^$|[\]\\]/g, '\\$&'); + s = s.replace(/\(([^)]*)\)/g, '(?:$1)?'); + s = s.replace(/\b(\w+(?:\/\w+)+)\b/g, (m) => '(?:' + m.split('/').join('|') + ')'); + s = s.replace(/\{string\}/g, '(?:"[^"]*"|\'[^\']*\')'); + s = s.replace(/\{int\}/g, '-?\\d+'); + s = s.replace(/\{float\}/g, '-?\\d*\\.?\\d+'); + s = s.replace(/\{word\}/g, '[^\\s]+'); + s = s.replace(/\{\}/g, '.*'); + return new RegExp('^' + s + '$'); +} + +function extractDefinitions(source, file) { + const definitions = []; + // webship-js registers some of its steps through aliases (ThenF, WhenF): + // they count as well, or an ambiguity with one of them goes unseen. + const re = /(?:^|\n)[ \t]*(Given|When|Then|defineStep)F?\(\s*(?:\/((?:\\\/|[^/\n])+)\/([a-z]*)|'((?:\\'|[^'\n])*)'|"((?:\\"|[^"\n])*)"|`([^`\n]*)`)/g; + let m; + while ((m = re.exec(source))) { + const index = m.index + (m[0].startsWith('\n') ? 1 : 0); + const line = source.slice(0, index).split('\n').length; + let regex = null; + let text; + if (m[2] !== undefined) { + text = '/' + m[2] + '/' + m[3]; + try { regex = new RegExp(m[2], m[3]); } catch (e) { regex = null; } + } else { + text = m[4] !== undefined ? m[4] : (m[5] !== undefined ? m[5] : m[6]); + try { regex = cucumberExpressionToRegex(text); } catch (e) { regex = null; } + } + const before = source.slice(0, index); + const docEnd = before.lastIndexOf('*/'); + let doc = null; + if (docEnd !== -1 && /^\s*$/.test(before.slice(docEnd + 2))) { + const docStart = before.lastIndexOf('/**', docEnd); + if (docStart !== -1) doc = before.slice(docStart, docEnd + 2); + } + const examples = []; + if (doc) { + for (const l of doc.split('\n')) { + const em = l.match(/Example\s*#?\d*\s*:\s*(.*)$/); + if (em) examples.push(em[1].trim()); + } + } + definitions.push({ file, line, keyword: m[1], text, regex, doc, examples }); + } + return definitions; +} + +function loadDir(dir, label) { + if (!fs.existsSync(dir)) return []; + let defs = []; + for (const f of fs.readdirSync(dir).filter((f) => f.endsWith('.js'))) { + defs = defs.concat(extractDefinitions(fs.readFileSync(path.join(dir, f), 'utf8'), label + f)); + } + return defs; +} + +function stripKeyword(s) { + return s.replace(/^(Given|When|Then|And|But|\*)\s+/, '').trim(); +} + +const packDefs = loadDir(PACK_DIR, ''); +const sharedDefs = SHARED_DIRS.reduce((all, dir) => all.concat(loadDir(dir, path.basename(path.dirname(path.dirname(dir))) + '/')), []); +const allDefs = packDefs.concat(sharedDefs).filter((d) => d.regex); +const problems = []; + +for (const d of packDefs) { + const where = `${d.file}:${d.line}`; + if (!d.regex) problems.push(`${where} step pattern did not compile: ${d.text}`); + if (!d.doc) { + problems.push(`${where} no JSDoc block above the definition`); + } else if (d.examples.length < MIN_EXAMPLES) { + problems.push(`${where} only ${d.examples.length} "Example #n:" line(s); ${MIN_EXAMPLES} are required`); + } + for (const example of d.examples) { + const body = stripKeyword(example); + const hits = allDefs.filter((o) => o.regex.test(body)); + if (!d.regex || !d.regex.test(body)) { + problems.push(`${where} example does not match its own definition: "${example}"`); + } + const others = hits.filter((o) => o !== d); + if (others.length) { + problems.push(`${where} example is ambiguous, also matched by ${others.map((o) => o.file + ':' + o.line).join(', ')}: "${example}"`); + } + } +} + +let featureSteps = 0; +// The must-fail scenarios (tests/check-must-fail.js runs them) are written with the same steps. +// The feature files are read in every folder under them. +const featureFiles = (dir) => fs.readdirSync(dir, { withFileTypes: true }).flatMap((e) => (e.isDirectory() + ? featureFiles(path.join(dir, e.name)).map((f) => path.join(e.name, f)) + : (e.name.endsWith('.feature') ? [e.name] : []))); +for (const dir of [FEATURES_DIR, path.join(ROOT, 'tests', 'must-fail')].filter((d) => fs.existsSync(d))) { + for (const f of featureFiles(dir)) { + const lines = fs.readFileSync(path.join(dir, f), 'utf8').split('\n'); + lines.forEach((l, i) => { + const m = l.match(/^\s*(Given|When|Then|And|But|\*)\s+(.*)$/); + if (!m) return; + featureSteps++; + const body = m[2].trim(); + const hits = allDefs.filter((d) => d.regex.test(body)); + if (hits.length === 0) problems.push(`${f}:${i + 1} undefined step: ${l.trim()}`); + else if (hits.length > 1) problems.push(`${f}:${i + 1} ambiguous step (${hits.map((h) => h.file + ':' + h.line).join(' | ')}): ${l.trim()}`); + }); + } +} + +const exampleCount = packDefs.reduce((n, d) => n + d.examples.length, 0); +console.log(`${packDefs.length} step definitions, ${exampleCount} examples, ${featureSteps} feature steps checked against ${allDefs.length} definitions.`); +if (problems.length) { + console.error(`\n${problems.length} problem(s):`); + for (const p of problems) console.error(' ' + p); + process.exit(1); +} +console.log('All examples match their own definition only; all feature steps resolve to exactly one definition.'); diff --git a/tests/check-must-fail.js b/tests/check-must-fail.js new file mode 100644 index 0000000..2cc6c92 --- /dev/null +++ b/tests/check-must-fail.js @@ -0,0 +1,120 @@ +#!/usr/bin/env node +'use strict'; + +// Runs the scenarios of tests/must-fail/ and checks that every one of them +// FAILS, at its last step, with the message its description announces +// ("Fails with: ..."), and that the message carries a hint. +// +// A step that cannot fail proves nothing. Each scenario here asserts something +// that is not true of the test site; the steps before the last one must pass. +// The scenarios leave the site as they found them (they read, and what one +// makes it removes again). They carry the tag @must-fail, which the default run +// of cucumber.js leaves out, and run in the lane of the run (LINE, as +// cucumber.js): the scenarios of one line only carry its tag (@line-8-1, +// @line-8-0). MUST_FAIL_TAGS narrows the run: MUST_FAIL_TAGS="@must-fail and not +// @wip". +// +// Usage: node tests/check-must-fail.js (the test site of cucumber.js must be up) + +const { spawnSync } = require('child_process'); +const fs = require('fs'); +const path = require('path'); + +const root = path.resolve(__dirname, '..'); +const line = process.env.LINE === '8.0.5.2' ? '8.0.5.2' : '8.1.4.1'; +// The line in the report's name, so the report of one line's run is never read as another's. +const reportName = `must-fail-${line}`; +const report = path.join(root, 'tests', 'reports', `${reportName}.json`); +const lane = ['@must-fail', 'not @wip', line === '8.0.5.2' ? 'not @line-8-1' : 'not @line-8-0'].join(' and '); +const features = fs.readdirSync(path.join(root, 'tests', 'must-fail')).filter((file) => file.endsWith('.feature')).map((file) => `tests/must-fail/${file}`); + +// Two runs: the scenarios against the web application, and those tagged @unreachable against an address nothing answers (a +// closed port), where every request fails before any answer: the failure a cookie would leak through, in Playwright's +// call log of the request, if the pack let it. +const unreachable = path.join(root, 'tests', 'reports', `${reportName}-unreachable.json`); +const output = []; +const started = Date.now(); +fs.rmSync(report, { force: true }); +fs.rmSync(unreachable, { force: true }); +for (const [tags, name, env] of [ + [`${process.env.MUST_FAIL_TAGS || lane} and not @unreachable`, reportName, {}], + [`${lane} and @unreachable`, `${reportName}-unreachable`, { LAUNCH_URL: 'http://127.0.0.1:9' }], +]) { + const run = spawnSync('npx', ['cucumber-js', '--config', 'cucumber.js'], { + cwd: root, + encoding: 'utf8', + stdio: ['ignore', 'pipe', 'pipe'], + env: { ...process.env, ...env, FEATURES: features.join(','), CUCUMBER_TAGS: tags, REPORT_NAME: name, WEBSHIP_SCREENSHOT_ON_FAILED: 'false' }, + }); + output.push(run.stdout || '', run.stderr || ''); +} + +if (!fs.existsSync(report) || !fs.existsSync(unreachable)) { + console.error('The must-fail run wrote no report: cucumber-js did not start.'); + process.exit(1); +} + +const strip = (text) => String(text || '').replace(/\u001b\[[0-9;]*m/g, ''); +const problems = []; +let count = 0; +for (const feature of [...JSON.parse(fs.readFileSync(report, 'utf8')), ...JSON.parse(fs.readFileSync(unreachable, 'utf8'))]) { + for (const scenario of feature.elements || []) { + count += 1; + const where = `${feature.uri}:${scenario.line} "${scenario.name}"`; + const wanted = (strip(scenario.description).match(/Fails with:\s*(.+)/) || [])[1]; + const steps = (scenario.steps || []).filter((step) => !step.hidden); + const last = steps[steps.length - 1]; + const earlier = steps.slice(0, -1).filter((step) => step.result.status !== 'passed'); + if (!wanted) { problems.push(`${where}: no "Fails with:" line in its description.`); continue; } + if (earlier.length) { problems.push(`${where}: an earlier step did not pass (${earlier[0].keyword}${earlier[0].name}: ${earlier[0].result.status}) ${strip(earlier[0].result.error_message).split('\n')[0]}`); continue; } + if (!last || last.result.status !== 'failed') { problems.push(`${where}: its last step ${last ? last.result.status : 'is missing'}; it must fail.`); continue; } + const message = strip(last.result.error_message); + if (!message.includes(wanted.trim())) { problems.push(`${where}: failed, but not with "${wanted.trim()}":\n ${message.split('\n').slice(0, 3).join('\n ')}`); continue; } + if (!/Hint:/.test(message)) { problems.push(`${where}: the failure carries no hint:\n ${message.split('\n')[0]}`); continue; } + console.log(` fails as it must: ${scenario.name}\n ${message.split('\n')[0].trim()}`); + } +} + +if (!count) problems.push('No must-fail scenario ran.'); + +// No secret anywhere: not in a failure, not in the runs' output, not in a report (JSON or HTML) of these runs, not in +// what a run leaves beside them (screenshots' names, attachments, traces, HAR files). The app's secret_key_base is +// known here; a session cookie's value and a password-reset token are found by their shapes. +const password = process.env.RAILS_DEMO_SECRET_KEY_BASE || process.env.WEB_APP_SECRET_KEY_BASE || ''; +const SHAPES = [ + [/(?:session_id|_[a-z0-9_]+_session)=(?!…)[A-Za-z0-9%+\/=_-]{16,}/, 'a session cookie\'s value'], + [/\/passwords\/(?!…)[A-Za-z0-9_=-]{20,}/, 'a password-reset token ("/passwords/")'], + [/"(?:session_id|_[a-z0-9_]+_session)"\s*,\s*"value"\s*:\s*"(?!…)[^"]{16,}/, 'a cookie\'s value in a report'], +]; +// (webship-js writes its HTML report of a run as tests/reports/cucumber_report.html: the one these runs wrote.) +const reports = fs.readdirSync(path.join(root, 'tests', 'reports')).filter((f) => /\.(json|html)$/.test(f) + && (f.startsWith(reportName) || fs.statSync(path.join(root, 'tests', 'reports', f)).mtimeMs >= started)); +// Everything else a run leaves: these folders, read whole (text files; a picture's name only). +const left = []; +const walk = (dir) => { + if (!fs.existsSync(dir)) return; + for (const f of fs.readdirSync(dir, { withFileTypes: true })) { + const p = path.join(dir, f.name); + if (f.isDirectory()) walk(p); + else if (fs.statSync(p).mtimeMs >= started) left.push(p); + } +}; +for (const dir of ['screenshots', 'videos', 'traces', 'test-results', path.join('tests', 'reports', 'attachments')]) walk(path.join(root, dir)); +const traces = left.filter((p) => /\.(har|zip)$|trace/i.test(p)); +for (const p of traces) problems.push(`${path.relative(root, p)}: a trace or a HAR file; the pack keeps them off (a reset link carries its token, and every cookie would be in it).`); +const texts = [ + ...output.map((t, i) => [`the output of run ${Math.floor(i / 2) + 1}`, t]), + ...reports.map((f) => [`tests/reports/${f}`, fs.readFileSync(path.join(root, 'tests', 'reports', f), 'utf8')]), + ...left.map((p) => [path.relative(root, p), /\.(png|jpe?g|webm|mp4)$/i.test(p) ? path.basename(p) : fs.readFileSync(p, 'utf8')]), +]; +for (const [where, text] of texts) { + if (password && text.includes(password)) problems.push(`${where} holds the app's secret_key_base.`); + for (const [re, what] of SHAPES) if (re.test(text)) problems.push(`${where} holds ${what}.`); +} +if (!reports.some((f) => f.endsWith('.html'))) problems.push('The must-fail runs wrote no HTML report to scan.'); +if (problems.length) { + console.error(`\n${problems.length} problem(s) in ${count} must-fail scenario(s):\n ${problems.join('\n ')}`); + process.exit(1); +} +console.log(`\n${count} must-fail scenarios on Rails ${line}: each failed at its last step with the announced message and a hint.`); +console.log(`No secret_key_base, session cookie or reset token in the runs' output, in ${reports.length} report(s) (${reports.join(', ')}) or in ${left.length} other file(s) the runs left; no trace and no HAR.`); diff --git a/tests/check-paths.js b/tests/check-paths.js new file mode 100644 index 0000000..e984431 --- /dev/null +++ b/tests/check-paths.js @@ -0,0 +1,95 @@ +#!/usr/bin/env node +'use strict'; + +// Checks that a feature, a scenario (file:line) or several features named on +// the command line of cucumber-js run alone, and that a run that names none +// runs every feature of tests/features/ (cucumber.js, commandLinePaths). Dry +// runs only: no browser, no site. Every run selects by path alone +// (CUCUMBER_TAGS, which cucumber.js reads, is set to a tag no scenario +// carries), so a feature whose scenarios all sit in a lane of their own is +// counted too. +// The JSON report of the last real run is left as it was. +// +// Usage: npm run test:paths + +const fs = require('fs'); +const os = require('os'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +const ROOT = path.resolve(__dirname, '..'); +const BIN = path.join(ROOT, 'node_modules', '@cucumber', 'cucumber', 'bin', 'cucumber.js'); +const EVERY_SCENARIO = 'not @no-such-tag-of-the-paths-check'; +const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'webship-js-paths-')); +const problems = []; + +// The dry runs also write the JSON report that cucumber.js names: the report +// of the last real run is put back afterwards. +const REPORT = path.join(ROOT, 'tests', 'reports', 'cucumber_report.json'); +const kept = path.join(tmp, 'kept-report.json'); +if (fs.existsSync(REPORT)) fs.copyFileSync(REPORT, kept); + +// The scenarios a dry run selects, read from a JSON report in the temporary folder. +function scenarios(args) { + const report = path.join(tmp, `run-${Date.now()}-${Math.random().toString(36).slice(2)}.json`); + const run = spawnSync(process.execPath, [BIN, '--config', 'cucumber.js', '--dry-run', ...args, '--format', `json:${report}`], { + cwd: ROOT, + encoding: 'utf8', + env: Object.assign({}, process.env, { WEBSHIP_REPORT_DISABLE: '1', FORCE_COLOR: '0', FEATURES: '', CUCUMBER_TAGS: EVERY_SCENARIO }), + }); + if (!fs.existsSync(report)) throw new Error(`cucumber-js ${args.join(' ')} wrote no report:\n${run.stderr}`); + const found = []; + for (const feature of JSON.parse(fs.readFileSync(report, 'utf8'))) { + for (const scenario of feature.elements || []) found.push(`${feature.uri}:${scenario.line}`); + } + return { found, warned: /specified paths in both/.test(run.stderr || '') }; +} + +// The feature files of tests/features/, as the paths of cucumber.js. Each name below is relative to tests/features/. +function featureFiles() { + return fs.readdirSync(path.join(ROOT, 'tests', 'features')).filter((f) => f.endsWith('.feature')).sort(); +} + +try { + const all = scenarios([]); + const files = featureFiles(); + if (!all.found.length) problems.push('a run that names no feature selected no scenario'); + const inAll = new Set(all.found.map((s) => s.split(':')[0])); + for (const f of files) { + if (!inAll.has(`tests/features/${f}`)) problems.push(`a run that names no feature left out tests/features/${f}`); + } + + const [first, second] = files; + const one = scenarios([`tests/features/${first}`]); + const own = all.found.filter((s) => s.startsWith(`tests/features/${first}:`)); + if (one.found.length !== own.length || one.found.some((s) => !s.startsWith(`tests/features/${first}:`))) { + problems.push(`naming tests/features/${first} selected ${one.found.length} scenario(s), not its own ${own.length}`); + } + if (one.warned) problems.push('naming a feature makes cucumber-js warn that the paths of the configuration and of the command line are merged'); + + const line = own[0].split(':')[1]; + const byLine = scenarios([`tests/features/${first}:${line}`]); + if (byLine.found.length !== 1 || byLine.found[0] !== own[0]) { + problems.push(`naming the scenario tests/features/${first}:${line} selected ${byLine.found.length} scenario(s), not 1`); + } + + const two = scenarios([`tests/features/${first}`, '--tags', EVERY_SCENARIO, `tests/features/${second}`]); + const ownTwo = all.found.filter((s) => s.startsWith(`tests/features/${first}:`) || s.startsWith(`tests/features/${second}:`)); + if (two.found.length !== ownTwo.length) { + problems.push(`naming two features around an option selected ${two.found.length} scenario(s), not their ${ownTwo.length}`); + } + if (!problems.length) { + console.log(` no feature named: ${all.found.length} scenarios; ${first}: ${one.found.length}; ${first}:${line}: 1; ${first} and ${second}: ${two.found.length}.`); + } +} finally { + if (fs.existsSync(kept)) fs.copyFileSync(kept, REPORT); + else fs.rmSync(REPORT, { force: true }); + fs.rmSync(tmp, { recursive: true, force: true }); +} + +if (problems.length) { + console.error(`\n${problems.length} problem(s) with the paths of the command line:`); + for (const p of problems) console.error(' ' + p); + process.exit(1); +} +console.log('A feature or a scenario named on the command line runs alone; naming none runs the whole suite.'); diff --git a/tests/features/app.feature b/tests/features/app.feature new file mode 100644 index 0000000..2272784 --- /dev/null +++ b/tests/features/app.feature @@ -0,0 +1,15 @@ +Feature: The web application as a whole + As the app's maintainer + I want its guards and its health in place + So that a forged form is refused and a probe knows it is up + + Scenario: Its health check, and forms without their CSRF token + Then the web application's health check should answer 200 + And the web application should refuse a "POST /session" without its CSRF token + And the web application should refuse a "POST /passwords" without its CSRF token + + @development + Scenario: Its error page for a missing record, in development + Given the web application has a user "editor@example.com" + And I am signed in to the web application as "editor@example.com" + Then the web application should show its error page for a missing "note" diff --git a/tests/features/notes.feature b/tests/features/notes.feature new file mode 100644 index 0000000..0eaa0ed --- /dev/null +++ b/tests/features/notes.feature @@ -0,0 +1,30 @@ +Feature: Notes in the web application + As a signed-in person + I want to write, change and remove notes + So that the app keeps what I write, and refuses what it cannot keep + + Background: + Given the web application has a user "editor@example.com" + And I am signed in to the web application as "editor@example.com" + + Scenario: A note is made, changed and destroyed, after a confirm + When I create a "note" in the web application with: + | Title | The quiet garden | + | Body | Lavender along the north wall. | + Then the web application should say "Note was successfully created." + When I edit the "note" "The quiet garden" in the web application with: + | Title | The quiet garden, in June | + Then the web application should say "Note was successfully updated." + When I destroy the "note" "The quiet garden, in June" in the web application and cancel + Then the web application should list the "note" "The quiet garden, in June" + When I destroy the "note" "The quiet garden, in June" in the web application and confirm + Then the web application should say "Note was successfully destroyed." + And the web application should not list the "note" "The quiet garden, in June" + And the web application should have sent no request outside its address + + Scenario: A note without a title is refused + When I try to create a "note" in the web application with: + | Title | | + | Body | A note with no name. | + Then the web application should show the error "Title can't be blank" + And the web application should show the error "1 error prohibited this note from being saved" diff --git a/tests/features/session.feature b/tests/features/session.feature new file mode 100644 index 0000000..eea7039 --- /dev/null +++ b/tests/features/session.feature @@ -0,0 +1,29 @@ +Feature: Signing in and out of the web application + As a person with an account on the web application + I want to sign in and out, and get back in when I forget my password + So that only I use my account + + Scenario: A user signs in and out + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + Then the web application should list the "note" "The harbour walk" + And the web application's session cookies should be safe for its scheme + When I sign out of the web application + Then I should be signed out of the web application + And the web application should have sent no request outside its address + + Scenario: A wrong password is refused + Given the web application has a user "reader@example.com" + When I try to sign in to the web application as "reader@example.com" with a wrong password + Then the web application should say "Try another email address or password." + And I should be signed out of the web application + + Scenario: A forgotten password is reset by mail, once + Given the web application has a user "reader@example.com" + When I ask the web application to reset the password of "reader@example.com" + Then the web application should say "Password reset instructions sent" + And the web application should have mailed "reader@example.com" a password reset link + When I follow the password reset link and choose a new password + Then the web application should say "Password has been reset." + And the password reset link should be refused by the web application + And I am signed in to the web application as "reader@example.com" diff --git a/tests/must-fail/web-app.feature b/tests/must-fail/web-app.feature new file mode 100644 index 0000000..aa42acb --- /dev/null +++ b/tests/must-fail/web-app.feature @@ -0,0 +1,72 @@ +# Each scenario fails at its last step by design. What a scenario makes (a user, a note, a mail), it removes at its end. +@must-fail +Feature: The web application, asserted wrong + Each scenario asserts something about the web application that is not true, at its last step. + + Scenario: A user the scenario did not make + Fails with: The scenario has made no user "nobody@example.com". + Given the web application has a user "reader@example.com" + Then I am signed in to the web application as "nobody@example.com" + + Scenario: Signed in, taken for signed out + Fails with: The web application still lets the browser in + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + Then I should be signed out of the web application + + Scenario: A note that is not there + Fails with: The web application lists no note "The missing note" + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + Then the web application should list the "note" "The missing note" + + Scenario: A note that is there, taken for gone + Fails with: The web application still lists the note "The harbour walk". + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + Then the web application should not list the "note" "The harbour walk" + + Scenario: Another notice + Fails with: The web application does not say "Note was successfully destroyed." + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + When I create a "note" in the web application with: + | Title | A note of the must-fail run | + Then the web application should say "Note was successfully destroyed." + + Scenario: Another error + Fails with: The web application's errors do not say "Body can't be blank" + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + When I try to create a "note" in the web application with: + | Title | | + Then the web application should show the error "Body can't be blank" + + Scenario: A refused note, taken for a kept one + Fails with: The web application answered the note's form with 302, not 422: it took the record. + Given the web application has a user "reader@example.com" + And I am signed in to the web application as "reader@example.com" + When I try to create a "note" in the web application with: + | Title | A note the app keeps | + + Scenario: A form with its token, taken for a forged one + Fails with: The web application answered POST /up without its CSRF token with + Then the web application should refuse a "POST /up" without its CSRF token + + Scenario: A mail never asked for + Fails with: The web application's mail catcher holds no mail to "reader@example.com" since the reset was asked. + Given the web application has a user "reader@example.com" + Then the web application should have mailed "reader@example.com" a password reset link + + Scenario: A used link, taken for a fresh one + Fails with: The web application shows no new-password form at the reset link. + Given the web application has a user "reader@example.com" + When I ask the web application to reset the password of "reader@example.com" + And the web application should have mailed "reader@example.com" a password reset link + And I follow the password reset link and choose a new password + Then I follow the password reset link and choose a new password + + @unreachable + Scenario: An app that does not answer, the secrets kept out of the failure + Fails with: The web application's health check did not answer + Then the web application's health check should answer 200 diff --git a/tests/step-definitions/rails-app.steps.js b/tests/step-definitions/rails-app.steps.js new file mode 100644 index 0000000..41b9d52 --- /dev/null +++ b/tests/step-definitions/rails-app.steps.js @@ -0,0 +1,246 @@ +'use strict'; + +// The app as a whole: its session cookies' flags for the page's scheme, its refusal of a form without its CSRF token, +// its health check, a password reset by mail (the mail read from the app's mail catcher, never its log; the link +// followed; a used link refused), its development error page, and the check that the page asks no other site. + +const { When, Then } = require('@cucumber/cucumber'); +const { gotoUrl } = require('webship-js/tests/step-definitions/webship'); +const h = require('./rails-support'); + +/** + * The app's cookies are HttpOnly, SameSite=Lax, and Secure exactly when the page is https (plain on http: a Secure + * cookie would never come back over http). + * + * Example #1: Then the web application's session cookies should be safe for its scheme + * Example #2: And the web application's session cookies should be safe for its scheme + * Example #3: Then the web application's session cookies should be safe for its scheme + * Example #4: And the web application's session cookies should be safe for its scheme + * Example #5: * the web application's session cookies should be safe for its scheme + * + */ +Then(/^the web application's session cookies should be safe for its scheme$/, async function () { + const page = this.page; + const https = new URL(h.base(this)).protocol === 'https:'; + const cookies = await page.context().cookies(h.base(this)); + if (!cookies.length) throw h.failure(page, 'The web application has set no cookie.', { hint: 'Sign in first: the session cookies come with a session.' }); + const wrong = []; + for (const c of cookies) { + if (!c.httpOnly) wrong.push(`${c.name} is not HttpOnly`); + if (c.sameSite !== 'Lax' && c.sameSite !== 'Strict') wrong.push(`${c.name} is SameSite=${c.sameSite}`); + if (https && !c.secure) wrong.push(`${c.name} is not Secure on https`); + if (!https && c.secure) wrong.push(`${c.name} is Secure on plain http (it never comes back)`); + } + if (wrong.length) { + throw h.failure(page, `The web application's cookies are not safe for ${https ? 'https' : 'http'}: ${wrong.join('; ')}.`, { + hint: 'Behind a TLS proxy the app sees http: trust its X-Forwarded-Proto and flag cookies on secure requests only (config.force_ssl with ssl_options redirect: false), never on plain http.', + }); + } +}); + +/** + * A form posted without the app's CSRF token (outside the page, with the page's cookies) is refused: 422. + * + * Example #1: Then the web application should refuse a "POST /notes" without its CSRF token + * Example #2: And the web application should refuse a "POST /session" without its CSRF token + * Example #3: Then the web application should refuse a "POST /passwords" without its CSRF token + * Example #4: And the web application should refuse a "DELETE /session" without its CSRF token + * Example #5: * the web application should refuse a "PATCH /notes/1" without its CSRF token + * + */ +Then(/^the web application should refuse a "(POST|PATCH|PUT|DELETE) (\/[^"]*)" without its CSRF token$/, async function (method, path) { + const page = this.page; + let res; + try { + res = await page.context().request.fetch(`${h.base(this)}${path}`, { method, form: { probe: 'webship' }, failOnStatusCode: false, maxRedirects: 0 }); + } catch (e) { + throw h.failure(page, `The web application did not answer ${method} ${path}: ${h.hide(this, e.message).split('\n')[0]}`, { hint: 'Check that it is up at the launch URL.' }); + } + if (res.status() !== 422) { + throw h.failure(page, `The web application answered ${method} ${path} without its CSRF token with ${res.status()}, not 422.`, { hint: 'Rails refuses it with protect_from_forgery (on by default in ActionController::Base).' }); + } +}); + +/** + * The app's health check (/up) answers 200. + * + * Example #1: Then the web application's health check should answer 200 + * Example #2: And the web application's health check should answer 200 + * Example #3: Then the web application's health check should answer 200 + * Example #4: And the web application's health check should answer 200 + * Example #5: * the web application's health check should answer 200 + * + */ +Then(/^the web application's health check should answer 200$/, async function () { + let status = 0; + try { + status = (await (await h.requests(this)).get(`${h.base(this)}/up`, { failOnStatusCode: false })).status(); + } catch (e) { + throw h.failure(this.page, `The web application's health check did not answer: ${h.hide(this, e.message).split('\n')[0]}`, { hint: 'Check that it is up at the launch URL.' }); + } + if (status !== 200) throw h.failure(this.page, `The web application's health check answered ${status}, not 200.`, { hint: 'Rails answers /up with rails/health#show: 500 when the app did not boot.' }); +}); + +/** + * Ask for a password reset for a user the scenario made, at /passwords/new. + * + * Example #1: When I ask the web application to reset the password of "reader@example.com" + * Example #2: When we ask the web application to reset the password of "editor@example.com" + * Example #3: And I ask the web application to reset the password of "reader@example.com" + * Example #4: Given I ask the web application to reset the password of "night-shift@example.org" + * Example #5: * I ask the web application to reset the password of "visitor@example.com" + * + */ +When(/^(?:I|we) ask the web application to reset the password of "([^"]+@[^"]+)"$/, async function (email) { + const page = this.page; + if (!this.rsUsers[email]) throw h.failure(page, `The scenario has made no user "${email}": a reset is only ever asked for one.`, { hint: `Make it first: Given the web application has a user "${email}"` }); + this.rsResetSince = Date.now() - 2000; + await gotoUrl(page, `${h.base(this)}/passwords/new`); + await page.locator('#email_address').fill(email); + await Promise.all([ + page.waitForResponse((r) => r.request().method() === 'POST' && new URL(r.url()).pathname === '/passwords', { timeout: h.WAIT.element }), + page.getByRole('button', { name: /Email reset instructions/i }).click(), + ]); + await page.waitForURL((u) => new URL(u).pathname !== '/passwords/new', { timeout: h.WAIT.element }).catch(() => {}); +}); + +/** + * The app's mail catcher holds a mail to this address, sent since the reset was asked, with a password-reset link; the + * link is kept in memory for the scenario (never shown), and the mail is removed at its end. + * + * Example #1: Then the web application should have mailed "reader@example.com" a password reset link + * Example #2: And the web application should have mailed "editor@example.com" a password reset link + * Example #3: Then the web application should have mailed "night-shift@example.org" a password reset link + * Example #4: And the web application should have mailed "reader@example.com" a password reset link + * Example #5: * the web application should have mailed "visitor@example.com" a password reset link + * + */ +Then(/^the web application should have mailed "([^"]+@[^"]+)" a password reset link$/, async function (email) { + const end = Date.now() + h.WAIT.mail; + const since = this.rsResetSince || 0; + let found = null; + let seen = 0; + while (Date.now() < end && !found) { + const messages = (await h.mailFor(this, email)).filter((m) => Date.parse(m.Created) >= since); + seen = messages.length; + for (const m of messages) { + if (!this.rsMail.includes(m.ID)) this.rsMail.push(m.ID); + const full = await h.mailMessage(this, m.ID); + const text = `${(full && full.Text) || ''}\n${(full && full.HTML) || ''}`; + const link = text.match(/https?:\/\/[^\s"'<>]+\/passwords\/([^/\s"'<>]+)\/edit/); + if (link) { found = { url: link[0], token: link[1] }; break; } + } + if (!found) await this.page.waitForTimeout(500); + } + if (!found) { + throw h.failure(this.page, `The web application's mail catcher holds ${seen ? `${seen} mail(s) to "${email}" but none with a password reset link` : `no mail to "${email}"`} since the reset was asked.`, { + hint: 'Check the app\'s mail delivery (SMTP to the mail catcher) and worldParameters.webApp.mailUrl.', + }); + } + this.rsTokens.push(found.token); + this.rsReset = { email, url: found.url }; +}); + +/** + * Follow the reset link from the mail (its path, at the app's address) and set a new password (random, in memory, now + * the user's); waits for the app's answer. + * + * Example #1: When I follow the password reset link and choose a new password + * Example #2: When we follow the password reset link and choose a new password + * Example #3: And I follow the password reset link and choose a new password + * Example #4: Then I follow the password reset link and choose a new password + * Example #5: * I follow the password reset link and choose a new password + * + */ +When(/^(?:I|we) follow the password reset link and choose a new password$/, async function () { + const page = this.page; + if (!this.rsReset) throw h.failure(page, 'The scenario has no password reset link.', { hint: 'Read it from the mail first: Then the web application should have mailed "…" a password reset link' }); + const path = new URL(this.rsReset.url).pathname; + await gotoUrl(page, `${h.base(this)}${path}`); + const field = page.locator('#password'); + if (!(await field.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + throw h.failure(page, 'The web application shows no new-password form at the reset link.', { hint: 'A used or expired link sends the browser to /passwords/new.' }); + } + const password = h.newPassword(); + for (const sel of ['#password', '#password_confirmation']) { + await page.locator(sel).evaluate((input, value) => { + Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(input, value); + input.dispatchEvent(new Event('input', { bubbles: true })); + }, password); + } + await Promise.all([ + // The form sends to the token's own address (/passwords/), not the page's (/passwords//edit). + page.waitForResponse((r) => r.request().method() !== 'GET' && new URL(r.url()).pathname.startsWith('/passwords/'), { timeout: h.WAIT.element }), + page.getByRole('button', { name: /^Save$/i }).click(), + ]); + await page.waitForURL((u) => new URL(u).pathname === '/session/new', { timeout: h.WAIT.element }).catch(() => {}); + this.rsUsers[this.rsReset.email].password = password; +}); + +/** + * The reset link, once used, is refused: the app sends the browser back to ask again. + * + * Example #1: Then the password reset link should be refused by the web application + * Example #2: And the password reset link should be refused by the web application + * Example #3: Then the password reset link should be refused by the web application + * Example #4: And the password reset link should be refused by the web application + * Example #5: * the password reset link should be refused by the web application + * + */ +Then(/^the password reset link should be refused by the web application$/, async function () { + const page = this.page; + if (!this.rsReset) throw h.failure(page, 'The scenario has no password reset link.', { hint: 'Read it from the mail first: Then the web application should have mailed "…" a password reset link' }); + await gotoUrl(page, `${h.base(this)}${new URL(this.rsReset.url).pathname}`); + await page.waitForURL((u) => new URL(u).pathname === '/passwords/new', { timeout: h.WAIT.element }).catch(() => {}); + if (await page.locator('#password_confirmation').isVisible().catch(() => false)) { + throw h.failure(page, 'The web application still takes the password reset link.', { hint: 'A reset link works once: use it first, When I follow the password reset link and choose a new password' }); + } +}); + +/** + * In development, the app's error page for a record that is not there (ActiveRecord::RecordNotFound), with nothing of + * the scenario's secrets on it. Tag the scenario @development: a production app answers a plain 404 page. + * + * Example #1: Then the web application should show its error page for a missing "note" + * Example #2: And the web application should show its error page for a missing "note" + * Example #3: Then the web application should show its error page for a missing "book" + * Example #4: And the web application should show its error page for a missing "note" + * Example #5: * the web application should show its error page for a missing "note" + * + */ +Then(/^the web application should show its error page for a missing "([^"]+)"$/, async function (name) { + const page = this.page; + const r = h.resource(name); + const since = (this._jsErrors || []).length; + await gotoUrl(page, `${h.base(this)}/${r.path}/999999999`).catch(() => {}); + const head = (await page.locator('h1, h2').first().innerText({ timeout: h.WAIT.element }).catch(() => '')).trim(); + // The page answers 404: the browser's own console line for it is allowed here only. + await page.waitForTimeout(300); + h.allowErrors(this, since, [new RegExp(`^Failed to load resource: the server responded with a status of 404 \\([^)]*\\) @ ${h.escape(new URL(h.base(this)).origin)}/${h.escape(r.path)}/999999999$`)], 'the error page'); + if (!/RecordNotFound/.test(head)) { + throw h.failure(page, `The web application shows no error page for a missing ${r.label}${head ? `; it shows "${head.slice(0, 120)}"` : ''}.`, { hint: 'In development the app shows its exception page; a production app answers a plain 404 (tag the scenario @development).' }); + } + const html = await page.content(); + const leaked = Object.values(this.rsUsers || {}).some((u) => u.password && html.includes(u.password)) || (h.settings(this).secretKeyBase && html.includes(h.settings(this).secretKeyBase)); + if (leaked) throw h.failure(page, 'The web application\'s error page shows a secret of the scenario.', { hint: 'Its request parameters must be filtered (config.filter_parameters).' }); +}); + +/** + * Every request the page sent in the scenario went to the app's own address: nothing to another site. + * + * Example #1: Then the web application should have sent no request outside its address + * Example #2: And the web application should have sent no request outside its address + * Example #3: Then the web application should have sent no request outside its address + * Example #4: And the web application should have sent no request outside its address + * Example #5: * the web application should have sent no request outside its address + * + */ +Then(/^the web application should have sent no request outside its address$/, async function () { + const origin = new URL(h.base(this)).origin; + const outside = (this.rsRequests || []).filter((u) => /^https?:/.test(u) && new URL(u).origin !== origin); + if (outside.length) { + throw h.failure(this.page, `The web application's pages sent ${outside.length} request(s) outside ${origin}: ${[...new Set(outside.map((u) => new URL(u).origin))].join(', ')}.`, { + hint: 'An import map pin, a font or a script from another site: pin it locally (bin/importmap pin … --download).', + }); + } +}); diff --git a/tests/step-definitions/rails-resources.steps.js b/tests/step-definitions/rails-resources.steps.js new file mode 100644 index 0000000..f156646 --- /dev/null +++ b/tests/step-definitions/rails-resources.steps.js @@ -0,0 +1,253 @@ +'use strict'; + +// A scaffold's resources, by the framework's conventions: //new and its labelled fields, "Create ", +// a record's page at // with "Edit this " and "Destroy this " (and its confirm), the +// list at / where each record is the element of its dom_id (_), the notices the app sets, and +// the errors that refuse a record. Forms are sent by Turbo (fetch): every step waits on the app's answer and on the +// address, never on a page load. What a scenario makes is removed at its end, through the app's console. + +const { When, Then } = require('@cucumber/cucumber'); +const { gotoUrl } = require('webship-js/tests/step-definitions/webship'); +const h = require('./rails-support'); + +/** Fill a form's fields by their labels, from a table of | field | value | rows. */ +async function fillByLabels(world, table) { + const page = world.page; + for (const [label, value] of table.raw()) { + const field = page.getByLabel(label, { exact: true }).first(); + if (!(await field.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + const labels = (await page.locator('form label').allInnerTexts().catch(() => [])).map((l) => l.trim()).filter(Boolean); + throw h.failure(page, `The web application's form has no field "${label}"${labels.length ? `; it has ${labels.map((l) => `"${l}"`).join(', ')}` : ''}.`, { hint: 'Name a field by its label, as the form shows it.' }); + } + await field.fill(value); + } +} + +/** Press a form's button and wait for the app's answer to it; resolves with that answer. */ +async function press(world, name) { + const page = world.page; + const button = page.getByRole('button', { name, exact: true }).first(); + if (!(await button.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + throw h.failure(page, `The web application's page shows no "${name}" button.`, { hint: 'A scaffold\'s form says "Create " and "Update ".' }); + } + const [res] = await Promise.all([ + page.waitForResponse((r) => r.request().method() !== 'GET' && new URL(r.url()).origin === new URL(h.base(world)).origin, { timeout: h.WAIT.element }), + button.click(), + ]); + return res; +} + +/** A record's id, found on the resource's list by a text it shows (its element is its dom_id, _). */ +async function findRecord(world, r, text) { + const page = world.page; + await gotoUrl(page, `${h.base(world)}/${r.path}`); + const item = page.locator(`[id^="${r.word}_"]`).filter({ hasText: text }).first(); + if (!(await item.waitFor({ state: 'attached', timeout: h.WAIT.element }).then(() => true, () => false))) { + const shown = (await page.locator(`[id^="${r.word}_"]`).count().catch(() => 0)); + throw h.failure(page, `The web application lists no ${r.label} "${text}" (it lists ${shown}).`, { hint: `Make it first: When I create a "${r.word}" in the web application with: ...` }); + } + const id = (await item.getAttribute('id')).slice(r.word.length + 1); + return id; +} + +/** + * Make a record through the resource's new form (//new), its fields by their labels; the app answers with + * the record's page. Removed at the scenario's end. + * + * Example #1: When I create a "note" in the web application with: + * | Title | The harbour walk | + * Example #2: When we create a "note" in the web application with: + * | Title | The lighthouse steps | + * | Body | Ninety-one steps. | + * Example #3: And I create a "note" in the web application with: + * | Title | The market list | + * Example #4: Given I create a "book" in the web application with: + * | Name | The quiet garden | + * Example #5: * I create a "note" in the web application with: + * | Title | Webship notes | + * + */ +When(/^(?:I|we) create a "([^"]+)" in the web application with:$/, async function (name, table) { + const page = this.page; + const r = h.resource(name); + await gotoUrl(page, `${h.base(this)}/${r.path}/new`); + await fillByLabels(this, table); + const res = await press(this, `Create ${r.Label}`); + await page.waitForURL((u) => new RegExp(`/${r.path}/\\d+$`).test(new URL(u).pathname), { timeout: h.WAIT.element }).catch(() => {}); + const m = new URL(page.url()).pathname.match(new RegExp(`/${r.path}/(\\d+)$`)); + if (!m) { + const errors = (await page.locator('#error_explanation, [id$="error_explanation"], form div:has(> ul)').first().innerText().catch(() => '')).replace(/\s+/g, ' ').trim(); + throw h.failure(page, `The web application did not make the ${r.label}: it answered ${res.status()}${errors ? ` and says "${errors.slice(0, 160)}"` : ''}.`, { hint: 'A record the app refuses shows why: When I try to create a "…" in the web application with: …, then Then the web application should show the error "…"' }); + } + this.rsRecords.push({ model: r.model, id: m[1] }); +}); + +/** + * Send the resource's new form expecting the app to refuse it (422, its errors shown). The browser's own console line for + * that answer ("Failed to load resource … 422 … @
/") is allowed in this step only. + * + * Example #1: When I try to create a "note" in the web application with: + * | Title | | + * Example #2: When we try to create a "note" in the web application with: + * | Body | No title at all. | + * Example #3: And I try to create a "note" in the web application with: + * | Title | | + * Example #4: Given I try to create a "book" in the web application with: + * | Name | | + * Example #5: * I try to create a "note" in the web application with: + * | Title | | + * + */ +When(/^(?:I|we) try to create a "([^"]+)" in the web application with:$/, async function (name, table) { + const page = this.page; + const r = h.resource(name); + const since = (this._jsErrors || []).length; + await gotoUrl(page, `${h.base(this)}/${r.path}/new`); + await fillByLabels(this, table); + const res = await press(this, `Create ${r.Label}`); + if (res.status() !== 422) { + const m = new URL(page.url()).pathname.match(new RegExp(`/${r.path}/(\\d+)$`)); + if (m) this.rsRecords.push({ model: r.model, id: m[1] }); + throw h.failure(page, `The web application answered the ${r.label}'s form with ${res.status()}, not 422: it took the record.`, { hint: 'The app refuses a record its validations do not allow; check the model\'s validations.' }); + } + await page.waitForTimeout(300); + const origin = h.escape(new URL(h.base(this)).origin); + h.allowErrors(this, since, [new RegExp(`^Failed to load resource: the server responded with a status of 422 \\([^)]*\\) @ ${origin}/${h.escape(r.path)}$`)], `the ${r.label}'s refusal`); +}); + +/** + * Open a record found on the list by a text it shows, edit it with its form, and wait for the app's answer. + * + * Example #1: When I edit the "note" "The harbour walk" in the web application with: + * | Title | The harbour walk, at dusk | + * Example #2: When we edit the "note" "The lighthouse steps" in the web application with: + * | Body | Counted three times. | + * Example #3: And I edit the "note" "The market list" in the web application with: + * | Title | The market list, Saturday | + * Example #4: Given I edit the "book" "The quiet garden" in the web application with: + * | Name | The quiet garden, again | + * Example #5: * I edit the "note" "Webship notes" in the web application with: + * | Title | Webship notes, edited | + * + */ +When(/^(?:I|we) edit the "([^"]+)" "([^"]+)" in the web application with:$/, async function (name, text, table) { + const page = this.page; + const r = h.resource(name); + const id = await findRecord(this, r, text); + await gotoUrl(page, `${h.base(this)}/${r.path}/${id}/edit`); + await fillByLabels(this, table); + const res = await press(this, `Update ${r.Label}`); + await page.waitForURL((u) => new URL(u).pathname === `/${r.path}/${id}`, { timeout: h.WAIT.element }).catch(() => {}); + if (new URL(page.url()).pathname !== `/${r.path}/${id}`) { + throw h.failure(page, `The web application did not take the ${r.label}'s changes: it answered ${res.status()}.`, { hint: 'Check the values against the model\'s validations.' }); + } +}); + +/** + * Destroy a record found on the list by a text it shows: its page's "Destroy this ", and the browser's confirm + * answered (confirm: the record goes; cancel: it stays). + * + * Example #1: When I destroy the "note" "The harbour walk" in the web application and confirm + * Example #2: When we destroy the "note" "The lighthouse steps" in the web application and cancel + * Example #3: And I destroy the "note" "The market list" in the web application and confirm + * Example #4: Given I destroy the "book" "The quiet garden" in the web application and cancel + * Example #5: * I destroy the "note" "Webship notes" in the web application and confirm + * + */ +When(/^(?:I|we) destroy the "([^"]+)" "([^"]+)" in the web application and (confirm|cancel)$/, async function (name, text, answer) { + const page = this.page; + const r = h.resource(name); + const id = await findRecord(this, r, text); + await gotoUrl(page, `${h.base(this)}/${r.path}/${id}`); + const button = page.getByRole('button', { name: `Destroy this ${r.label}`, exact: true }).first(); + if (!(await button.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + throw h.failure(page, `The web application's page of the ${r.label} shows no "Destroy this ${r.label}".`, { hint: 'A scaffold\'s show page carries it.' }); + } + let asked = null; + page.once('dialog', async (d) => { asked = d.message(); if (answer === 'confirm') await d.accept(); else await d.dismiss(); }); + if (answer === 'confirm') { + await Promise.all([ + page.waitForResponse((res) => res.request().method() !== 'GET' && new URL(res.url()).pathname === `/${r.path}/${id}`, { timeout: h.WAIT.element }), + button.click(), + ]); + await page.waitForURL((u) => new URL(u).pathname === `/${r.path}`, { timeout: h.WAIT.element }).catch(() => {}); + } else { + await button.click(); + await page.waitForTimeout(600); + } + if (asked === null) { + throw h.failure(page, `The web application destroyed the ${r.label} without asking first.`, { hint: 'Turbo asks with the form\'s data-turbo-confirm (button_to …, form: { data: { turbo_confirm: "…" } }).' }); + } + this.rsAsked = asked; +}); + +/** + * The resource's list (/) shows a record with this text. + * + * Example #1: Then the web application should list the "note" "The harbour walk" + * Example #2: And the web application should list the "note" "The lighthouse steps" + * Example #3: Then the web application should list the "note" "The market list" + * Example #4: And the web application should list the "book" "The quiet garden" + * Example #5: * the web application should list the "note" "Webship notes" + * + */ +Then(/^the web application should list the "([^"]+)" "([^"]+)"$/, async function (name, text) { + await findRecord(this, h.resource(name), text); +}); + +/** + * The resource's list (/) shows no record with this text. + * + * Example #1: Then the web application should not list the "note" "The harbour walk" + * Example #2: And the web application should not list the "note" "The lighthouse steps" + * Example #3: Then the web application should not list the "note" "The market list" + * Example #4: And the web application should not list the "book" "The quiet garden" + * Example #5: * the web application should not list the "note" "Webship notes" + * + */ +Then(/^the web application should not list the "([^"]+)" "([^"]+)"$/, async function (name, text) { + const page = this.page; + const r = h.resource(name); + await gotoUrl(page, `${h.base(this)}/${r.path}`); + await page.waitForLoadState('domcontentloaded'); + const n = await page.locator(`[id^="${r.word}_"]`).filter({ hasText: text }).count(); + if (n) throw h.failure(page, `The web application still lists the ${r.label} "${text}".`, { hint: `Destroy it first: When I destroy the "${r.word}" "${text}" in the web application and confirm` }); +}); + +/** + * The page shows this text: a notice or an alert the app set ("Note was successfully created."), or any text of it. + * + * Example #1: Then the web application should say "Note was successfully created." + * Example #2: And the web application should say "Note was successfully destroyed." + * Example #3: Then the web application should say "Try another email address or password." + * Example #4: And the web application should say "Password has been reset." + * Example #5: * the web application should say "Note was successfully updated." + * + */ +Then(/^the web application should say "([^"]+)"$/, async function (text) { + const page = this.page; + const found = page.getByText(text, { exact: false }).first(); + if (!(await found.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + const first = (await page.locator('body').innerText().catch(() => '')).split('\n').map((l) => l.trim()).filter(Boolean).slice(0, 3).join(' | '); + throw h.failure(page, `The web application does not say "${text}"; it shows "${h.hide(this, first).slice(0, 160)}".`, { hint: 'A notice shows once, on the page the app sends the browser to after a form.' }); + } +}); + +/** + * The refused form shows this error among its errors (the scaffold's "… prohibited this … from being saved:" list). + * + * Example #1: Then the web application should show the error "Title can't be blank" + * Example #2: And the web application should show the error "1 error prohibited this note from being saved" + * Example #3: Then the web application should show the error "Name can't be blank" + * Example #4: And the web application should show the error "Title can't be blank" + * Example #5: * the web application should show the error "Title is too long" + * + */ +Then(/^the web application should show the error "([^"]+)"$/, async function (text) { + const page = this.page; + const errors = page.locator('div:has(> h2:has-text("prohibited this")), #error_explanation').first(); + const shown = (await errors.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => errors.innerText(), () => '')).replace(/\s+/g, ' ').trim(); + if (!shown.includes(text)) { + throw h.failure(page, shown ? `The web application's errors do not say "${text}"; they say "${shown.slice(0, 200)}".` : `The web application shows no errors on its form.`, { hint: 'Send a form the app refuses first: When I try to create a "…" in the web application with: …' }); + } +}); diff --git a/tests/step-definitions/rails-session.steps.js b/tests/step-definitions/rails-session.steps.js new file mode 100644 index 0000000..d1872d0 --- /dev/null +++ b/tests/step-definitions/rails-session.steps.js @@ -0,0 +1,140 @@ +'use strict'; + +// Users and their sessions, the way the framework's authentication generator makes them: a user made in the app +// through its console (removed at the scenario's end), signing in at /session/new, signing out with the app's +// "Sign out", and the check that a page then asks to sign in again. A password is handed to the page in memory, set into +// the password field by its id: never in a step's words, never typed through a tool's argument, never in a message. + +const { Given, When, Then } = require('@cucumber/cucumber'); +const { gotoUrl } = require('webship-js/tests/step-definitions/webship'); +const h = require('./rails-support'); + +/** Fill the sign-in form and submit it; resolves with the response of its post. */ +async function submitSignIn(world, email, password) { + const page = world.page; + await gotoUrl(page, `${h.base(world)}/session/new`); + const field = page.locator('#email_address'); + if (!(await field.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + throw h.failure(page, 'The web application shows no sign-in form at /session/new.', { hint: 'The authentication generator makes it (bin/rails generate authentication).' }); + } + await field.fill(email); + await page.locator('#password').evaluate((input, value) => { + Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(input, value); + input.dispatchEvent(new Event('input', { bubbles: true })); + }, password); + const [res] = await Promise.all([ + page.waitForResponse((r) => r.request().method() === 'POST' && new URL(r.url()).pathname === '/session', { timeout: h.WAIT.element }), + page.getByRole('button', { name: /^Sign in$/i }).click(), + ]); + // Turbo follows the app's redirect after the answer: the page leaves the sign-in form when it signed in, and comes back + // to it with the app's alert when it did not. + await page.waitForURL((u) => new URL(u).pathname !== '/session/new', { timeout: 5000 }).catch(() => {}); + await page.waitForLoadState('domcontentloaded').catch(() => {}); + return res; +} + +/** + * The app has a user with this email address, made through its console with a password made for it (random, in memory + * only); removed, with its sessions, at the scenario's end. + * + * Example #1: Given the web application has a user "reader@example.com" + * Example #2: And the web application has a user "editor@example.com" + * Example #3: Given the web application has a user "night-shift@example.org" + * Example #4: And the web application has a user "reader@example.com" + * Example #5: * the web application has a user "visitor@example.com" + * + */ +Given(/^the web application has a user "([^"]+@[^"]+)"$/, async function (email) { + const password = h.newPassword(); + const out = await h.rubyInApp(this, [ + `if User.exists?(email_address: ${h.rb(email)}) then puts "taken" else`, + ` User.create!(email_address: ${h.rb(email)}, password: ${h.rb(password)})`, + ' puts "made"', + 'end', + ].join('\n')); + if (/taken/.test(out)) { + throw h.failure(this.page, `The web application already has a user "${email}" this scenario did not make.`, { hint: 'A scenario makes its own users and removes them at its end: pick an address the app does not have.' }); + } + if (!/made/.test(out)) throw h.failure(this.page, `The web application did not make the user "${email}".`, { hint: 'Its console ran, but said nothing: check that the app has a User model (bin/rails generate authentication).' }); + this.rsUsers[email] = { password }; +}); + +/** + * Sign in at the app's sign-in page as a user the scenario made, with its password; ends on the page the app sends a + * signed-in person to. + * + * Example #1: Given I am signed in to the web application as "reader@example.com" + * Example #2: Given we are signed in to the web application as "editor@example.com" + * Example #3: When I am signed in to the web application as "reader@example.com" + * Example #4: And I am signed in to the web application as "night-shift@example.org" + * Example #5: * I am signed in to the web application as "visitor@example.com" + * + */ +Given(/^(?:I am|we are) signed in to the web application as "([^"]+@[^"]+)"$/, async function (email) { + const user = this.rsUsers[email]; + if (!user) throw h.failure(this.page, `The scenario has made no user "${email}".`, { hint: `Make it first: Given the web application has a user "${email}"` }); + await submitSignIn(this, email, user.password); + if (new URL(this.page.url()).pathname === '/session/new') { + const said = (await this.page.locator('body').innerText().catch(() => '')).split('\n').filter(Boolean)[0] || ''; + throw h.failure(this.page, `The web application did not sign "${email}" in${said ? `: it says "${h.hide(this, said)}"` : ''}.`, { hint: 'Check the user\'s password (the scenario\'s own), and the app\'s rate limit on signing in (10 tries in 3 minutes).' }); + } + this.rsSignedIn = email; +}); + +/** + * Try to sign in with a password that is not the user's; the app refuses it and stays on its sign-in page. + * + * Example #1: When I try to sign in to the web application as "reader@example.com" with a wrong password + * Example #2: When we try to sign in to the web application as "editor@example.com" with a wrong password + * Example #3: And I try to sign in to the web application as "reader@example.com" with a wrong password + * Example #4: Given I try to sign in to the web application as "night-shift@example.org" with a wrong password + * Example #5: * I try to sign in to the web application as "visitor@example.com" with a wrong password + * + */ +When(/^(?:I|we) try to sign in to the web application as "([^"]+@[^"]+)" with a wrong password$/, async function (email) { + await submitSignIn(this, email, `wrong-${h.newPassword()}`); +}); + +/** + * Sign out with the app's own "Sign out" (DELETE /session); waits for its answer. + * + * Example #1: When I sign out of the web application + * Example #2: When we sign out of the web application + * Example #3: And I sign out of the web application + * Example #4: Then I sign out of the web application + * Example #5: * I sign out of the web application + * + */ +When(/^(?:I|we) sign out of the web application$/, async function () { + const page = this.page; + const out = page.getByRole('button', { name: /^Sign out$/i }).first(); + if (!(await out.waitFor({ state: 'visible', timeout: h.WAIT.element }).then(() => true, () => false))) { + throw h.failure(page, 'The web application shows no "Sign out".', { hint: 'Sign in first; the app\'s layout carries a "Sign out" button (button_to "Sign out", session_path, method: :delete).' }); + } + await Promise.all([ + page.waitForResponse((r) => r.request().method() !== 'GET' && new URL(r.url()).pathname === '/session', { timeout: h.WAIT.element }), + out.click(), + ]); + await page.waitForURL((u) => new URL(u).pathname === '/session/new', { timeout: h.WAIT.element }).catch(() => {}); + this.rsSignedIn = null; +}); + +/** + * Nobody is signed in: the app's home page sends the browser to its sign-in page. + * + * Example #1: Then I should be signed out of the web application + * Example #2: And I should be signed out of the web application + * Example #3: Then we should be signed out of the web application + * Example #4: And we should be signed out of the web application + * Example #5: * I should be signed out of the web application + * + */ +Then(/^(?:I|we) should be signed out of the web application$/, async function () { + const page = this.page; + await gotoUrl(page, `${h.base(this)}/`); + await page.waitForURL((u) => new URL(u).pathname === '/session/new', { timeout: h.WAIT.element }).catch(() => {}); + const where = new URL(page.url()).pathname; + if (where !== '/session/new') { + throw h.failure(page, `The web application still lets the browser in: its home page answered at ${where}, not its sign-in page.`, { hint: 'Sign out first: When I sign out of the web application' }); + } +}); diff --git a/tests/step-definitions/rails-support.js b/tests/step-definitions/rails-support.js new file mode 100644 index 0000000..6a9bff7 --- /dev/null +++ b/tests/step-definitions/rails-support.js @@ -0,0 +1,238 @@ +'use strict'; + +// Shared helpers for the step files of this pack. +// +// Not a step file: it registers no step definitions (only hooks: one that notes every request a page sends, one that +// keeps secrets out of webship-js's list of the browser's errors, and one that undoes what a scenario made). It holds +// what the steps share, and what a project can require for steps of its own: the settings (worldParameters.webApp), +// the app's console (bin/rails runner -, the Ruby read on its input), the users and records a scenario made (removed +// at its end), the mail catcher's messages, and the browser errors the app logs at known moments. +// +// A secret is never shown: not a password, not a session cookie's value, not the app's secret_key_base, not a +// password-reset token (in a link's path, /passwords//edit, or anywhere else). A password a scenario makes lives +// in memory for that scenario; the user is removed at its end. Secrets reach the app's console on its input, inside +// the Ruby it runs, never on a command line. + +const crypto = require('crypto'); +const { spawn } = require('child_process'); +const { Before, After, AfterStep } = require('@cucumber/cucumber'); +// Playwright as webship-js has it (the pack adds no copy of its own). +const { request: playwrightRequest } = require(require.resolve('playwright', { paths: [require.resolve('webship-js/package.json')] })); +const webship = require('webship-js/tests/step-definitions/webship'); + +// The scenario that runs now: a failure's whole text (with the page's address webship-js adds, "Page: …") is masked +// with its secrets. +let current = null; + +/** webship-js's failure, its whole message masked: the page's address may be a reset link. */ +function failure(page, message, options) { + const e = webship.failure(page, message, options); + if (current && e && e.message) e.message = hide(current, e.message); + return e; +} + +/** webship-js's friendly error, its whole message masked. */ +function friendly(options) { + const e = webship.friendly(options); + if (current && e && e.message) e.message = hide(current, e.message); + return e; +} + +// The budgets of the waits (milliseconds): each is a ceiling, not a pause. +const WAIT = { element: 15000, mail: 20000, console: 60000 }; + +/** The settings of the pack, `worldParameters.webApp` in cucumber.js: `console` (a command, as words), `mailUrl`, `secretKeyBase`. */ +function settings(world) { + const own = (world.parameters && world.parameters.webApp) || {}; + return { console: own.console || [], mailUrl: String(own.mailUrl || '').replace(/\/+$/, ''), secretKeyBase: own.secretKeyBase || '' }; +} + +/** The app's address, the launch URL of cucumber.js, without a trailing slash. */ +function base(world) { + const url = (world.parameters && world.parameters.launchUrl) || world.launchUrl || ''; + if (!url) throw friendly({ message: 'No launch URL is set, so the web application has no address.', hint: 'Set worldParameters.launchUrl in cucumber.js, or LAUNCH_URL in the environment.' }); + return String(url).replace(/\/+$/, ''); +} + +/** Every secret taken out of a text: passwords, cookie values, secret_key_base, reset tokens and links. */ +function hide(world, text) { + let out = String(text === undefined || text === null ? '' : text); + const secrets = [ + settings(world).secretKeyBase, + ...Object.values(world.rsUsers || {}).map((u) => u.password), + ...(world.rsCookieValues || []), + ...(world.rsTokens || []), + ].filter((s) => s && s.length >= 6); + for (const s of secrets) out = out.split(s).join('…'); + return out + .replace(/(\/passwords\/)[^/\s"'?#]+(\/edit)?/g, '$1…$2') + .replace(/((?:session_id|_[a-z0-9_]*_session|remember_token|token|secret_key_base)["']?\s*[=:]\s*["']?)[^"'&;\s,}]+/gi, '$1…'); +} + +/** A word for a resource, in a class name, a path and its labels: "note" -> { model: Note, path: notes, label: Note }. */ +function resource(name) { + const word = String(name).trim().toLowerCase().replace(/\s+/g, '_'); + const model = word.split('_').map((w) => w[0].toUpperCase() + w.slice(1)).join(''); + const label = word.replace(/_/g, ' '); + const path = word.endsWith('y') && !/[aeiou]y$/.test(word) ? `${word.slice(0, -1)}ies` : (/(s|x|z|ch|sh)$/.test(word) ? `${word}es` : `${word}s`); + return { word, model, path, label, Label: label[0].toUpperCase() + label.slice(1) }; +} + +/** + * Run Ruby in the app (its console: bin/rails runner -, the code read on its input). The secrets of the code stay on + * the input; what it prints comes back, secrets taken out of anything that goes wrong. + */ +function rubyInApp(world, code) { + const cmd = settings(world).console; + if (!Array.isArray(cmd) || !cmd.length) { + return Promise.reject(friendly({ message: 'No console is set for the web application.', hint: 'Set worldParameters.webApp.console in cucumber.js: the words of a command that runs the Ruby on its input in the app, e.g. ["ddev", "exec", "bin/rails", "runner", "-"].' })); + } + return new Promise((resolve, reject) => { + const child = spawn(cmd[0], cmd.slice(1), { stdio: ['pipe', 'pipe', 'pipe'] }); + let out = ''; + let err = ''; + const timer = setTimeout(() => { child.kill('SIGKILL'); }, WAIT.console); + child.stdout.on('data', (d) => { out += d; }); + child.stderr.on('data', (d) => { err += d; }); + child.on('error', (e) => { clearTimeout(timer); reject(friendly({ message: `The web application's console did not start: ${hide(world, e.message)}`, hint: `Check worldParameters.webApp.console (${cmd[0]}).` })); }); + child.on('close', (code) => { + clearTimeout(timer); + if (code === 0) resolve(out); + else reject(friendly({ message: `The web application's console failed (exit ${code}): ${hide(world, (err || out).trim().split('\n').slice(-2).join(' ')).slice(0, 300)}`, hint: 'Check that the app is up and that its console command runs bin/rails runner - in it.' })); + }); + child.stdin.end(code); + }); +} + +/** A Ruby string literal of a text (its own quoting: no injection). */ +function rb(text) { + return JSON.stringify(String(text)); +} + +/** A password made for a user of a scenario: random, in memory only. */ +function newPassword() { + return `Ws-${crypto.randomBytes(15).toString('base64url')}`; +} + +/** The pack's own request context, for the mail catcher and the requests outside the page. */ +async function requests(world) { + if (!world.rsRequest) world.rsRequest = await playwrightRequest.newContext({ ignoreHTTPSErrors: true }); + return world.rsRequest; +} + +/** The messages the mail catcher (Mailpit's API) holds for an address, newest first: [{ ID, Subject, Created }]. */ +async function mailFor(world, address) { + const url = settings(world).mailUrl; + if (!url) throw friendly({ message: 'No mail catcher is set for the web application.', hint: 'Set worldParameters.webApp.mailUrl in cucumber.js: the address of its mail catcher (Mailpit).' }); + let res; + try { + res = await (await requests(world)).get(`${url}/api/v1/search?query=${encodeURIComponent(`to:"${address}"`)}`, { failOnStatusCode: false }); + } catch (e) { + throw friendly({ message: `The web application's mail catcher did not answer: ${hide(world, e.message).split('\n')[0]}`, hint: 'Check worldParameters.webApp.mailUrl (Mailpit\'s address).' }); + } + if (res.status() !== 200) throw friendly({ message: `The web application's mail catcher answered ${res.status()}.`, hint: 'Check worldParameters.webApp.mailUrl (Mailpit\'s address).' }); + const body = await res.json(); + return (body.messages || []); +} + +/** One message's text and HTML. */ +async function mailMessage(world, id) { + const res = await (await requests(world)).get(`${settings(world).mailUrl}/api/v1/message/${encodeURIComponent(id)}`, { failOnStatusCode: false }); + return res.status() === 200 ? res.json() : null; +} + +/** Escape a text for a regular expression. */ +function escape(text) { + return String(text).replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +/** + * Take the errors a step allows out of webship-js's list of the browser's errors, from a point (the list's length when + * the moment began) to now: only those matching the patterns, and only in that window. Counts them for the report. + */ +function allowErrors(world, since, patterns, moment) { + const errs = world._jsErrors || []; + const kept = errs.slice(0, since); + let allowed = 0; + for (const e of errs.slice(since)) { + const text = `${e.message}${e.url ? ` @ ${e.url}` : ''}`; + if (patterns.some((re) => re.test(e.message) || re.test(text))) allowed += 1; + else kept.push(e); + } + if (world._jsErrors) world._jsErrors.splice(0, world._jsErrors.length, ...kept); + if (allowed) { + world.rsAllowed = world.rsAllowed || []; + world.rsAllowed.push(`${moment}: ${allowed}`); + } + return allowed; +} + +/** The values of the app's cookies now (to keep them out of any text the scenario prints). */ +async function noteCookies(world) { + if (!world.page) return; + try { + const cookies = await world.page.context().cookies(base(world)); + for (const c of cookies) if (c.value && !world.rsCookieValues.includes(c.value)) world.rsCookieValues.push(c.value); + } catch (e) { /* the page is gone */ } +} + +/** + * Take every secret out of webship-js's list of the browser's errors, in place: the app's pages carry reset tokens in + * their addresses, and webship-js prints these errors as they are. Kept until a webship-js release redacts them itself: + * https://github.com/webship/webship-js/issues/707 + */ +function redactErrors(world) { + for (const e of world._jsErrors || []) { + if (e.message) e.message = hide(world, e.message); + if (e.url) e.url = hide(world, e.url); + } +} + +// The requests the page sends (for the check that it sends none outside the site), and what the scenario makes. +Before(function () { + current = this; + this.rsUsers = {}; + this.rsRecords = []; + this.rsMail = []; + this.rsTokens = []; + this.rsCookieValues = []; + this.rsRequests = []; + this.rsAllowed = []; + this.rsRequest = null; + this.rsSignedIn = null; + const page = this.page; + if (page) page.on('request', (r) => { this.rsRequests.push(r.url()); }); +}); + +// After each step (before any hook at the scenario's end, where webship-js reports them): the cookies' values noted, +// the browser's errors without secrets. +AfterStep(async function () { + await noteCookies(this); + redactErrors(this); +}); + +// What a scenario made, undone: its records, its users (with their sessions), the mail it had sent to them. Then the +// browser's errors once more without secrets, and every error a step allowed counted in the report. +After(async function () { + await noteCookies(this); + const users = Object.keys(this.rsUsers || {}); + const records = this.rsRecords || []; + if (users.length || records.length) { + const code = [ + ...records.map((r) => `${r.model}.where(id: ${Number(r.id)}).destroy_all`), + ...users.map((email) => `User.where(email_address: ${rb(email)}).each { |u| u.sessions.destroy_all if u.respond_to?(:sessions); u.destroy }`), + ].join('\n'); + await rubyInApp(this, code).catch(() => {}); + } + if ((this.rsMail || []).length && settings(this).mailUrl) { + await (await requests(this)).delete(`${settings(this).mailUrl}/api/v1/messages`, { data: { IDs: this.rsMail }, failOnStatusCode: false }).catch(() => {}); + } + if (this.rsRequest) await this.rsRequest.dispose().catch(() => {}); + this.rsRequest = null; + redactErrors(this); + if (this.rsAllowed && this.rsAllowed.length && typeof this.attach === 'function') { + await this.attach(`Browser errors the steps allowed, at their moments: ${this.rsAllowed.join('; ')}`, 'text/plain'); + } +}); + +module.exports = { WAIT, settings, base, hide, resource, rubyInApp, rb, newPassword, requests, mailFor, mailMessage, escape, allowErrors, noteCookies, redactErrors, failure, friendly }; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..8d35549 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "CommonJS", + "strict": true, + "esModuleInterop": true, + "types": [ + "node" + ] + }, + "ts-node": { + "ignore": [ + "node_modules/(?!webship-js/)" + ] + } +} From 4c20a02af621869833a95e853dd62ade10ac8fe7 Mon Sep 17 00:00:00 2001 From: Rajab Natshah Date: Fri, 4 Dec 2026 20:09:48 +0300 Subject: [PATCH 2/3] Make the CI's secret_key_base 128 hex characters The demo refuses a secret shorter than 64 characters, as a real secret_key_base is: openssl rand -hex 64, as bin/rails secret makes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 040ba9e..3e91d23 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -69,7 +69,7 @@ jobs: - name: The secret of the run run: | for name in RAILS_DEMO_SECRET_KEY_BASE; do - secret="$(openssl rand -hex 24)" + secret="$(openssl rand -hex 64)" echo "::add-mask::${secret}" echo "${name}=${secret}" >> "$GITHUB_ENV" done From 6ea6bd2692d5c6f62faafbbdc40e4fd8548a4ede Mon Sep 17 00:00:00 2001 From: Rajab Natshah Date: Fri, 4 Dec 2026 21:57:52 +0300 Subject: [PATCH 3/3] Ask Ruby for its version at the end of the demo script RUBY_VERSION is in the official Ruby image's environment, not in every image the script runs in (DDEV's web container, where the Workspace's plugin makes the app): under set -u its last line failed the whole make. Co-Authored-By: Claude Opus 5.5 --- demo/rails-demo-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/rails-demo-app.sh b/demo/rails-demo-app.sh index dc6b946..3c8d8df 100755 --- a/demo/rails-demo-app.sh +++ b/demo/rails-demo-app.sh @@ -116,4 +116,4 @@ RUBY sed -i -E 's/^(\s*config\.(assume_ssl|force_ssl) = true)/# \1 (rails-demo-app.sh: see config\/initializers\/webship_demo.rb)/' config/environments/production.rb bin/rails db:prepare > /dev/null bin/rails db:seed -echo "The demo app ${APP}: Rails $(bin/rails -v | awk '{print $2}') on Ruby ${RUBY_VERSION}." +echo "The demo app ${APP}: Rails $(bin/rails -v | awk '{print $2}') on Ruby $(ruby -e 'print RUBY_VERSION')."