frontend-go-live-check 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## 1.5.0
4
4
 
5
+ - **Your own tests in the same report**: unit tests (Vitest, Jest, Karma or `npm test`) with code coverage, and end-to-end tests (Playwright Test, Cypress) against the production build. A new area: *Tests, user flows and business rules*.
6
+ - **User flows and business rules without code** in `go-live-check/flows.json`: open, fill, select, click, see, url and API checks (status and JSON values), on every screen size. A broken business rule is a blocker.
7
+ - **Forms filled with valid data** and sent: they must save and tell the user (only on this computer or allowed hosts).
8
+ - **Postman collection run in order** with its `pm.test` scripts and the variables carried between requests; `api.variables` for `{{variables}}`.
9
+ - **Load profiles**: `light`, `standard` (50 users, 1 minute) and `stress` (finds the breaking point); `--load <profile>`.
10
+ - **Security**: CORS (which websites may read the API) and the HTTPS certificate and TLS version.
11
+ - **Code quality**: `lint` / `typecheck` scripts, unused and outdated libraries, very long files, copied code.
5
12
  - **One folder for everything**: `go-live-check/` holds the settings (`config.json`), the test passwords (`.env`), the API files (`api/`), the design baseline (`baseline/`), the report (`report/`) and a saved sign-in (`session.json`), with its own `.gitignore`. `init` creates it. Projects with the older root files keep working; the README shows how to move.
6
13
  - Every section of the HTML report opens and closes (accordion), with **Expand all** and **Collapse all**.
7
14
  - The date and time the report was created are at the top of the HTML report, on the PDF and Word cover, and in the page header.
package/README.md CHANGED
@@ -65,6 +65,7 @@ my-project/
65
65
  │ │ ├── postman_collection.json ← your Postman collection
66
66
  │ │ ├── postman_environment.json ← optional: its environment
67
67
  │ │ └── openapi.json ← or/and your OpenAPI file
68
+ │ ├── flows.json ← your user journeys and business rules (optional)
68
69
  │ ├── baseline/ ← the approved look of every page (commit it)
69
70
  │ ├── report/ ← the results: HTML, PDF, Word, zip (Git ignores it)
70
71
  │ ├── session.json ← a saved sign-in, after `login` (Git ignores it)
@@ -75,7 +76,7 @@ my-project/
75
76
 
76
77
  | Commit | Never commit (already ignored) |
77
78
  | --- | --- |
78
- | `config.json`, `.env.example`, `api/`, `baseline/` | `.env`, `report/`, `session.json` |
79
+ | `config.json`, `.env.example`, `api/`, `flows.json`, `baseline/` | `.env`, `report/`, `session.json` |
79
80
 
80
81
  <details>
81
82
  <summary><b>Set up with an older version?</b></summary>
@@ -192,6 +193,9 @@ The report lists every sign-in method found (*email and password · Google · UA
192
193
 
193
194
  | | Area | What is checked |
194
195
  | :-: | --- | --- |
196
+ | ✅ | **Unit and end-to-end tests** | Runs **your own tests**: Vitest, Jest, Karma or `npm test` with code coverage (low coverage is reported), and your Playwright or Cypress tests against the production build |
197
+ | 🧭 | **User flows and business rules** | Your main journeys and business rules, written **without code** in `go-live-check/flows.json` (open, fill, click, see, check the API answer), on every screen size; a broken business rule blocks going live |
198
+ | 📝 | **Forms with valid data** | Every form is filled with valid test data and sent: it must save and tell the user (only on this computer or allowed test hosts) |
195
199
  | 🧭 | **Functionality** | JavaScript errors, console errors, failed requests, broken links, images and anchors, blank pages, buttons covered by something else, unfinished text (`undefined`, `NaN`, `[object Object]`, translation keys, lorem ipsum, TODO), loading spinners that never stop, the production build, the "page not found" page |
196
200
  | 🛟 | **Resilience** | Each page opened again with its API calls failing: does it crash, go blank, or tell the user? |
197
201
  | 📱 | **Design and responsive layout** | Every page at every screen size: sideways scrolling, text that spills out of its box (a button too small for its label), text on top of other text, content cut off at the screen edge, text cut off inside its box, overlapping buttons, stretched or squashed images, tiny text on phones, right-to-left layout (Arabic, Hebrew…), fonts that fail to load, too many fonts and sizes |
@@ -199,12 +203,12 @@ The report lists every sign-in method found (*email and password · Google · UA
199
203
  | ♿ | **Accessibility** | axe-core against WCAG 2.0 / 2.1 / 2.2 A and AA; keyboard-only use: visible focus, no traps, nothing that only a mouse can click; form field types |
200
204
  | ⚡ | **Performance** | Size, JavaScript, requests, load time, LCP, layout shift and frozen-page time for every page, against budgets; Lighthouse as a phone and as a desktop |
201
205
  | 🔌 | **API calls made by the pages** | Slow, very large, repeated, too many, uncompressed or uncached calls |
202
- | 📈 | **Load** | 10 users at the same time on the main pages and the app's own read requests |
206
+ | 📈 | **Load** | Profiles: `light` (10 users, every run), `standard` (50 users for a minute, added gradually) and `stress` (adds users until the app slows down or fails: the **breaking point**) |
203
207
  | 🔐 | **Sign-in and access** | Every sign-in method found (email, Google, Microsoft, Apple, UAE PASS, OpenID Connect) and its buttons; wrong password, unknown user, empty sign-in; a cancelled sign-in; signed-in pages and APIs opened without signing in; tokens in web storage; every form submitted empty |
204
- | 🧪 | **API tests** | From your **Postman collection or OpenAPI/Swagger file**: every endpoint with valid and invalid data, without a token, with the wrong role, and with another user's records |
205
- | 🛡️ | **Security** | Security headers, cookies, private files (`.env`, `.git`), source maps, secrets in the JavaScript or the source, passwords in addresses, outside scripts without integrity, `npm audit` |
208
+ | 🧪 | **API tests** | From your **Postman collection or OpenAPI/Swagger file**: every endpoint with valid and invalid data, without a token, with the wrong role, and with another user's records. Plus the **collection run in order with its own `pm.test` scripts**, the variables carried between requests (sign in → create → read → delete) |
209
+ | 🛡️ | **Security** | Security headers, cookies, CORS (which sites may read the API), the HTTPS certificate and TLS version, private files (`.env`, `.git`), source maps, secrets in the JavaScript or the source, passwords in addresses, outside scripts without integrity, `npm audit` |
206
210
  | 🔎 | **SEO and sharing** | Titles, descriptions, headings, language, duplicate titles, favicon, link previews, robots.txt and sitemap.xml |
207
- | 🧹 | **Code** | TypeScript errors, your own ESLint rules, leftover `console.log` |
211
+ | 🧹 | **Code** | TypeScript errors, your ESLint rules (or your `lint` / `typecheck` scripts), leftover `console.log`, libraries installed but never used, libraries a major version behind, very long files, copied code |
208
212
 
209
213
  The report's **What was checked** table says exactly what ran on your project, and why anything was skipped.
210
214
 
@@ -228,6 +232,44 @@ The report's **What was checked** table says exactly what ran on your project, a
228
232
 
229
233
  ---
230
234
 
235
+ ## User flows and business rules (no code)
236
+
237
+ The tool opens every page by itself, but only your team knows the journeys and the rules. Write them once in **`go-live-check/flows.json`**; every run checks them on desktop and phone, with a picture where a step fails.
238
+
239
+ ```json
240
+ {
241
+ "flows": [
242
+ {
243
+ "name": "A citizen sends a new application",
244
+ "rule": true,
245
+ "steps": [
246
+ { "open": "/applications/new" },
247
+ { "select": { "Service": "Permit" } },
248
+ { "fill": { "Description": "Permit for a small shop {unique}" } },
249
+ { "click": "Submit application" },
250
+ { "api": { "method": "POST", "path": "/api/applications", "status": 201, "body": { "status": "Submitted" } } },
251
+ { "url": "/applications" },
252
+ { "see": "Permit" }
253
+ ]
254
+ }
255
+ ]
256
+ }
257
+ ```
258
+
259
+ | Step | What it does |
260
+ | --- | --- |
261
+ | `open` | Opens an address of the app |
262
+ | `fill`, `select`, `check` | Fills fields found by their label, placeholder or name (`css=…` works too). `"$NAME"` comes from `.env`; `{unique}` is unique to the run |
263
+ | `click`, `press` | Clicks a button or link by its text; presses a key |
264
+ | `see`, `notSee` | A text must (or must not) be on the page |
265
+ | `url` | The address must start with this |
266
+ | `api` | The page called this API, it answered this status, and its JSON answer has these values |
267
+ | `wait` | Waits a moment (ms) |
268
+
269
+ A flow is signed in with the test user unless `"signedIn": false`. **`"rule": true`** marks a business rule ("a new application is Submitted", "a citizen sees only their own applications"): if it fails, it is a blocker.
270
+
271
+ ---
272
+
231
273
  ## Works with
232
274
 
233
275
  **Next.js** · **React** (Vite, Create React App) · **Vue** · **Nuxt** · **Angular** · **Svelte / SvelteKit** · **Astro** · **Remix / React Router** · **Gatsby** · **Solid** · **Preact** · **Qwik** · **plain HTML**. Anything else, in any language, works with a start command or `--url`.
@@ -365,7 +407,7 @@ The short name `go-live-check` works too. After `init`, use `npm run go-live`, `
365
407
 
366
408
  | Option | What it does |
367
409
  | --- | --- |
368
- | `--only pages,security` | Only these areas: `pages`, `lighthouse`, `auth`, `security`, `resilience`, `load`, `api`, `code` |
410
+ | `--only pages,security` | Only these areas: `pages`, `lighthouse`, `auth`, `flows`, `security`, `resilience`, `load`, `api`, `code`, `tests` |
369
411
  | `--skip lighthouse,load` | Everything except these |
370
412
  | `--api-only` | Only the API tests (backend projects) |
371
413
  | `--api <file or URL>` | The Postman collection or OpenAPI/Swagger file (found automatically in the project) |
@@ -376,6 +418,7 @@ The short name `go-live-check` works too. After `init`, use `npm run go-live`, `
376
418
  | `--no-lighthouse` · `--no-build` · `--no-export` | Skip Lighthouse · use the existing build · no PDF/Word |
377
419
  | `--format pdf` | Only one of the documents |
378
420
  | `--update-baseline` | Save the current look of every page as the new design baseline |
421
+ | `--load stress` | `light` (default) · `standard` (50 users for a minute) · `stress` (finds the breaking point) |
379
422
  | `--fail-on major` | What fails the command: `blocker` (default) · `major` · `minor` · `never` |
380
423
  | `--open` · `--out <folder>` · `--config <file>` · `--quiet` · `--ci` | Open the report · report folder · settings file · less output · pipeline mode |
381
424
 
@@ -485,7 +528,11 @@ Hide parts that change on their own (clocks, live data) with `"visualMask": [".c
485
528
  | `services` | Commands started first (a backend, a mock API), each ready when its `url` answers |
486
529
  | `build`, `start`, `url` | `false` or your own build command · your own start command (`{port}` / `$PORT`) · check a running site |
487
530
  | `budgets` | `pageKB` 3000 · `jsKB` 1000 · `requests` 120 · `loadMs` 4000 · `apiMs` 1000 · `apiCalls` 30 |
488
- | `load` | `{ "users": 10, "seconds": 10, "maxTargets": 8, "hosts": [] }`, or `false` (GET only; this computer or listed hosts) |
531
+ | `load` | `{ "profile": "light" | "standard" | "stress" }` or your own `users`, `seconds`, `rampSeconds`, `hosts`; or `false` (GET only; this computer or listed hosts) |
532
+ | `tests` | `{ "coverage": 60, "unitCommand": "…", "e2eCommand": "…" }`, or `false` to skip your own tests |
533
+ | `flows` | User journeys and business rules (or in `go-live-check/flows.json`) |
534
+ | `formFill` | `{ "hosts": ["test.example.com"] }` to also fill and send forms on a test host, or `false` |
535
+ | `api.variables` | Values for `{{variables}}` in the Postman collection, e.g. `{ "password": "$GO_LIVE_PASSWORD" }` |
489
536
  | `keyboard`, `resilience`, `visual`, `evidence`, `formChecks`, `lighthouse`, `discoverRoutes` | All on by default; `false` turns one off |
490
537
  | `visualThreshold`, `visualMask`, `baselineDir` | How much may change (0.1%); parts to hide; where the baseline lives |
491
538
  | `report` | `organisation`, `classification` (default *Internal*), `preparedFor`, `approvers`: shown in the PDF and Word |
@@ -546,7 +593,7 @@ No other services: nothing is uploaded, and no account is needed.
546
593
  <details>
547
594
  <summary><b>Does it replace unit and end-to-end tests?</b></summary>
548
595
 
549
- No. It checks what every web app needs before going live, without any test code. Your own tests still cover your business rules.
596
+ It runs them. Your own unit tests (with coverage) and your Playwright or Cypress tests are part of every run, and their results are in the same report and the same verdict. Your journeys and business rules can also be written as flows, without code. Writing the unit tests themselves is still your team's job: only you know what each function must do.
550
597
 
551
598
  </details>
552
599
 
@@ -567,10 +614,10 @@ Security headers, compression and caching usually come from your web server or C
567
614
  <details>
568
615
  <summary><b>What still needs a person?</b></summary>
569
616
 
570
- - whether the design matches what was intended (the screenshots make this quick);
571
- - business rules;
572
- - a full load test before a big launch;
573
- - a penetration test.
617
+ - whether the design matches what was intended (the screenshots and the visual comparison make this quick);
618
+ - writing the flows and unit tests for your business rules (the tool runs them every time);
619
+ - a load test from proper servers for a very large launch (the `stress` profile finds the breaking point on one machine);
620
+ - a penetration test by a security specialist before a big launch.
574
621
 
575
622
  </details>
576
623
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-go-live-check",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "description": "Is your frontend ready to go live? One command tests any web frontend (React, Next.js, Vue, Angular, Svelte, plain HTML…): pages, responsive design, accessibility, keyboard, performance and load, API calls, security, SEO, sign-in and APIs from Postman/OpenAPI. Report with evidence, PDF and Word, and a pipeline gate that approves or rejects the merge.",
5
5
  "homepage": "https://www.npmjs.com/package/frontend-go-live-check",
6
6
  "repository": {
package/schema.json CHANGED
@@ -169,7 +169,7 @@
169
169
  },
170
170
  "fields": {
171
171
  "type": "object",
172
- "description": "Other fields to fill: label \u2192 value."
172
+ "description": "Other fields to fill: label → value."
173
173
  },
174
174
  "expect": {
175
175
  "type": "string",
@@ -181,7 +181,7 @@
181
181
  "session",
182
182
  "token"
183
183
  ],
184
- "description": "form = fill the email/password form \u00b7 session = reuse the session saved by 'frontend-go-live-check login' \u00b7 token = a test token. Default: form when username/password are set, token when token is set, otherwise session."
184
+ "description": "form = fill the email/password form · session = reuse the session saved by 'frontend-go-live-check login' · token = a test token. Default: form when username/password are set, token when token is set, otherwise session."
185
185
  },
186
186
  "token": {
187
187
  "type": "object",
@@ -193,15 +193,15 @@
193
193
  },
194
194
  "cookies": {
195
195
  "type": "object",
196
- "description": "Cookie name \u2192 value."
196
+ "description": "Cookie name → value."
197
197
  },
198
198
  "localStorage": {
199
199
  "type": "object",
200
- "description": "Key \u2192 value, set before the app loads."
200
+ "description": "Key → value, set before the app loads."
201
201
  },
202
202
  "sessionStorage": {
203
203
  "type": "object",
204
- "description": "Key \u2192 value, set before the app loads."
204
+ "description": "Key → value, set before the app loads."
205
205
  }
206
206
  }
207
207
  },
@@ -210,7 +210,7 @@
210
210
  "description": "Where the saved session is kept. Default go-live-check/session.json (never commit it)."
211
211
  }
212
212
  },
213
- "description": "How the tool signs in. Email/password: page + username + password. Google, Microsoft, Apple, UAE PASS\u2026: \"method\": \"session\" and run frontend-go-live-check login once. Pipelines: see ciLogin."
213
+ "description": "How the tool signs in. Email/password: page + username + password. Google, Microsoft, Apple, UAE PASS…: \"method\": \"session\" and run frontend-go-live-check login once. Pipelines: see ciLogin."
214
214
  },
215
215
  "lighthouse": {
216
216
  "type": "boolean"
@@ -358,6 +358,13 @@
358
358
  },
359
359
  "seed": {
360
360
  "type": "integer"
361
+ },
362
+ "variables": {
363
+ "type": "object",
364
+ "additionalProperties": {
365
+ "type": "string"
366
+ },
367
+ "description": "Values for {{variables}} in the Postman collection, e.g. { \"password\": \"$GO_LIVE_PASSWORD\" }."
361
368
  }
362
369
  }
363
370
  }
@@ -422,6 +429,227 @@
422
429
  "ciLogin": {
423
430
  "$ref": "#/properties/login",
424
431
  "description": "Used instead of \"login\" in pipelines (no one there to approve a Google or UAE PASS sign-in): a test email/password on the test environment, or a test token from the pipeline's secrets."
432
+ },
433
+ "load": {
434
+ "description": "The load test: false, or a profile and/or your own numbers. GET requests only, on this computer or the hosts listed.",
435
+ "oneOf": [
436
+ {
437
+ "const": false
438
+ },
439
+ {
440
+ "type": "object",
441
+ "additionalProperties": false,
442
+ "properties": {
443
+ "profile": {
444
+ "enum": [
445
+ "light",
446
+ "standard",
447
+ "stress"
448
+ ],
449
+ "description": "light: 10 users for 10 s (default) · standard: 50 users for 60 s, added over 15 s · stress: adds 10 users every 10 s until the app gets slow or fails (the breaking point)"
450
+ },
451
+ "users": {
452
+ "type": "integer",
453
+ "minimum": 1
454
+ },
455
+ "seconds": {
456
+ "type": "integer",
457
+ "minimum": 1
458
+ },
459
+ "rampSeconds": {
460
+ "type": "integer",
461
+ "minimum": 0
462
+ },
463
+ "step": {
464
+ "type": "integer",
465
+ "minimum": 1,
466
+ "description": "stress: users added per step"
467
+ },
468
+ "maxTargets": {
469
+ "type": "integer",
470
+ "minimum": 1
471
+ },
472
+ "hosts": {
473
+ "type": "array",
474
+ "items": {
475
+ "type": "string"
476
+ },
477
+ "description": "Other hosts the load test may call (test environments only)."
478
+ }
479
+ }
480
+ }
481
+ ]
482
+ },
483
+ "tests": {
484
+ "description": "The project's own unit and end-to-end tests. false turns them off.",
485
+ "oneOf": [
486
+ {
487
+ "const": false
488
+ },
489
+ {
490
+ "type": "object",
491
+ "additionalProperties": false,
492
+ "properties": {
493
+ "unit": {
494
+ "type": "boolean",
495
+ "default": true
496
+ },
497
+ "e2e": {
498
+ "type": "boolean",
499
+ "default": true
500
+ },
501
+ "coverage": {
502
+ "type": "number",
503
+ "minimum": 0,
504
+ "maximum": 100,
505
+ "default": 60,
506
+ "description": "Minimum share of code lines covered by the unit tests (%)."
507
+ },
508
+ "unitCommand": {
509
+ "type": "string",
510
+ "description": "Your own command for the unit tests (instead of Vitest/Jest/Karma)."
511
+ },
512
+ "e2eCommand": {
513
+ "type": "string",
514
+ "description": "Your own command for the end-to-end tests. BASE_URL points at the app."
515
+ }
516
+ }
517
+ }
518
+ ]
519
+ },
520
+ "flows": {
521
+ "description": "User journeys and business rules, written without code (they can also be in go-live-check/flows.json).",
522
+ "type": "array",
523
+ "items": {
524
+ "type": "object",
525
+ "required": [
526
+ "name",
527
+ "steps"
528
+ ],
529
+ "properties": {
530
+ "name": {
531
+ "type": "string"
532
+ },
533
+ "rule": {
534
+ "type": "boolean",
535
+ "description": "A business rule: if it fails, it blocks going live."
536
+ },
537
+ "signedIn": {
538
+ "type": "boolean",
539
+ "default": true
540
+ },
541
+ "viewports": {
542
+ "type": "array",
543
+ "items": {
544
+ "type": "string"
545
+ }
546
+ },
547
+ "severity": {
548
+ "enum": [
549
+ "blocker",
550
+ "major",
551
+ "minor",
552
+ "info"
553
+ ]
554
+ },
555
+ "steps": {
556
+ "type": "array",
557
+ "items": {
558
+ "type": "object",
559
+ "minProperties": 1,
560
+ "maxProperties": 1,
561
+ "properties": {
562
+ "open": {
563
+ "type": "string",
564
+ "description": "Open this address, e.g. /applications"
565
+ },
566
+ "fill": {
567
+ "type": "object",
568
+ "additionalProperties": {
569
+ "type": "string"
570
+ },
571
+ "description": "Field label, placeholder or name → value. \"$NAME\" comes from .env; {unique} is unique to the run."
572
+ },
573
+ "select": {
574
+ "type": "object",
575
+ "additionalProperties": {
576
+ "type": "string"
577
+ }
578
+ },
579
+ "check": {
580
+ "type": "string"
581
+ },
582
+ "click": {
583
+ "type": "string",
584
+ "description": "Button or link text (or css=selector)."
585
+ },
586
+ "press": {
587
+ "type": "string"
588
+ },
589
+ "see": {
590
+ "type": "string"
591
+ },
592
+ "notSee": {
593
+ "type": "string"
594
+ },
595
+ "url": {
596
+ "type": "string",
597
+ "description": "The address must start with this."
598
+ },
599
+ "api": {
600
+ "type": "object",
601
+ "required": [
602
+ "path"
603
+ ],
604
+ "properties": {
605
+ "method": {
606
+ "type": "string"
607
+ },
608
+ "path": {
609
+ "type": "string",
610
+ "description": "e.g. /api/applications or /api/applications/:id"
611
+ },
612
+ "status": {
613
+ "type": "integer"
614
+ },
615
+ "body": {
616
+ "type": "object",
617
+ "description": "Values the JSON answer must have."
618
+ }
619
+ }
620
+ },
621
+ "wait": {
622
+ "type": "integer"
623
+ }
624
+ }
625
+ }
626
+ }
627
+ }
628
+ }
629
+ },
630
+ "formFill": {
631
+ "description": "Fill every form with valid test data and send it. Writes data: only on this computer or the hosts listed. false turns it off.",
632
+ "oneOf": [
633
+ {
634
+ "const": false
635
+ },
636
+ {
637
+ "type": "object",
638
+ "additionalProperties": false,
639
+ "properties": {
640
+ "hosts": {
641
+ "type": "array",
642
+ "items": {
643
+ "type": "string"
644
+ }
645
+ },
646
+ "max": {
647
+ "type": "integer",
648
+ "minimum": 1
649
+ }
650
+ }
651
+ }
652
+ ]
425
653
  }
426
654
  }
427
655
  }