frontend-go-live-check 0.0.0-stage → 1.2.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 +32 -0
- package/LICENSE +21 -0
- package/README.md +502 -2
- package/bin/frontend-go-live-check.mjs +4 -0
- package/docs/banner.jpg +0 -0
- package/docs/documents.png +0 -0
- package/docs/finding.png +0 -0
- package/docs/overview.png +0 -0
- package/docs/terminal.png +0 -0
- package/package.json +90 -4
- package/schema.json +427 -0
- package/src/api/fake.mjs +152 -0
- package/src/api/model.mjs +247 -0
- package/src/api/run.mjs +502 -0
- package/src/checks/auth.mjs +190 -0
- package/src/checks/browser.mjs +496 -0
- package/src/checks/code.mjs +81 -0
- package/src/checks/evidence.mjs +89 -0
- package/src/checks/in-page.mjs +228 -0
- package/src/checks/keyboard.mjs +75 -0
- package/src/checks/lighthouse.mjs +98 -0
- package/src/checks/load.mjs +79 -0
- package/src/checks/network.mjs +97 -0
- package/src/checks/resilience.mjs +67 -0
- package/src/checks/security.mjs +147 -0
- package/src/checks/sso.mjs +334 -0
- package/src/checks/visual.mjs +37 -0
- package/src/cli/main.mjs +162 -0
- package/src/commands/ci.mjs +237 -0
- package/src/commands/doctor.mjs +89 -0
- package/src/commands/export.mjs +70 -0
- package/src/commands/init.mjs +112 -0
- package/src/commands/login.mjs +79 -0
- package/src/commands/run.mjs +298 -0
- package/src/core/config.mjs +142 -0
- package/src/core/detect.mjs +105 -0
- package/src/core/login.mjs +260 -0
- package/src/core/project.mjs +240 -0
- package/src/core/routes.mjs +152 -0
- package/src/core/rules.mjs +575 -0
- package/src/core/session.mjs +147 -0
- package/src/export/docx.mjs +237 -0
- package/src/export/model.mjs +304 -0
- package/src/export/pdf.mjs +145 -0
- package/src/index.mjs +16 -0
- package/src/report/report.mjs +281 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
- **Sign-in with Google, Microsoft, Apple, UAE PASS and any OpenID Connect server.**
|
|
6
|
+
- `frontend-go-live-check login`: sign in once by hand; the session is saved (`go-live-check.session.json`, ignored by Git) and reused.
|
|
7
|
+
- `"method": "token"`: a test token (header, cookie, localStorage or sessionStorage).
|
|
8
|
+
- `ciLogin`: a separate sign-in for pipelines.
|
|
9
|
+
- Expired sessions are reported, including when the app's API answers 401.
|
|
10
|
+
- **Every sign-in button is found and checked, whatever it says.** It is found by its text, label, logo, where a click leads (the provider is never contacted), the provider's script, or the libraries in the code. The checks: HTTPS, `state`, PKCE instead of the token flow, the return address, the UAE PASS environment (staging or production) and `acr_values`, and what users see after a cancelled sign-in.
|
|
11
|
+
- The report, the PDF and the Word file list every sign-in method found. `doctor` shows how the tool will sign in and when the saved session expires.
|
|
12
|
+
- The README has a new *Sign-in* section.
|
|
13
|
+
|
|
14
|
+
## 1.0.0
|
|
15
|
+
|
|
16
|
+
First release.
|
|
17
|
+
|
|
18
|
+
- One command for any web frontend: Next.js, React, Vue, Angular, Svelte/SvelteKit, Nuxt, Astro, Remix, Gatsby, Solid, Preact, Qwik, plain HTML, or any running site with `--url`.
|
|
19
|
+
- Pages found by following links, from sitemap.xml, and from the routes in the source code.
|
|
20
|
+
- Checks: functionality and errors, resilience when the server fails, responsive layout, right-to-left layout, visual changes against a baseline, accessibility (axe-core, WCAG 2.2 AA), keyboard use, speed of every page with budgets, Lighthouse, sign-in and access, forms, security, SEO, code.
|
|
21
|
+
- API tests from Postman collections (with environments), OpenAPI 3 and Swagger 2.
|
|
22
|
+
- Automatic sign-in for common forms, including two-step forms.
|
|
23
|
+
- Commands: `init`, `doctor`, `plan`, and the check itself with `--quick`, `--only`, `--skip`, `--update-baseline`, `--open`.
|
|
24
|
+
- Report: HTML, JSON, JUnit and Markdown, with a "what was checked" table.
|
|
25
|
+
- Shareable Word (.docx) and PDF documents after every run: cover, document control, sign-off table, contents, executive summary, findings with IDs, evidence and fixes, appendices with screenshots. `frontend-go-live-check export` writes them again.
|
|
26
|
+
- A *Share this report* bar in the HTML report: download the PDF, the Word file, or everything as a .zip, or print.
|
|
27
|
+
- Evidence pictures with the problem elements outlined, plus elements, steps to reproduce and how to check the fix for every problem; problems per page and a fix checklist in the documents.
|
|
28
|
+
- Every request the app makes: slow, large, repeated, too many, uncompressed, not cached, sensitive values in addresses.
|
|
29
|
+
- Lag: how long scripts freeze each page; a light load test (several users at once, GET only).
|
|
30
|
+
- Design consistency: web fonts that fail, too many fonts and sizes; broken in-page anchors; form field types.
|
|
31
|
+
- Evidence pictures in the HTML report too; npm README with pictures; GitLab pipeline that publishes to npm with trusted publishing.
|
|
32
|
+
- `frontend-go-live-check ci github|gitlab|azure|bitbucket|jenkins`: a pipeline that approves or rejects the merge.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ahmed Khedr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,503 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://unpkg.com/frontend-go-live-check@1/docs/banner.jpg" alt="frontend-go-live-check: is your frontend ready to go live? One command tells you." width="100%">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://www.npmjs.com/package/frontend-go-live-check"><img src="https://img.shields.io/npm/v/frontend-go-live-check?color=2f6bff&label=npm" alt="npm version"></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/frontend-go-live-check"><img src="https://img.shields.io/npm/dm/frontend-go-live-check?color=10b981" alt="downloads per month"></a>
|
|
8
|
+
<img src="https://img.shields.io/node/v/frontend-go-live-check?color=555" alt="Node.js version">
|
|
9
|
+
<img src="https://img.shields.io/badge/WCAG-2.2%20AA-8a2be2" alt="WCAG 2.2 AA">
|
|
10
|
+
<img src="https://img.shields.io/npm/l/frontend-go-live-check?color=555" alt="MIT license">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<b>One command. Every page, every screen size, every API. One verdict.</b><br>
|
|
15
|
+
Builds your app like production, tests it in a real browser, and tells you whether it is ready to go live,<br>
|
|
16
|
+
with a picture of every problem and how to fix it. No tests to write.
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="#quick-start">Quick start</a> ·
|
|
21
|
+
<a href="#sign-in-email-google-microsoft-uae-pass">Sign-in</a> ·
|
|
22
|
+
<a href="#what-it-checks">What it checks</a> ·
|
|
23
|
+
<a href="#the-report">The report</a> ·
|
|
24
|
+
<a href="#pipelines-approve-or-reject-the-merge">Pipelines</a> ·
|
|
25
|
+
<a href="#settings">Settings</a> ·
|
|
26
|
+
<a href="#faq">FAQ</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install --save-dev frontend-go-live-check
|
|
35
|
+
npx frontend-go-live-check init
|
|
36
|
+
npm run go-live
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
That's it. The result is `go-live-report/index.html`, plus a PDF and a Word file to share with your team.
|
|
40
|
+
|
|
41
|
+
`init` adds the `go-live` scripts and a settings file, and downloads the test browser. It never overwrites anything.
|
|
42
|
+
|
|
43
|
+
Have an API? Save your Postman collection as **`api/postman_collection.json`** (or your OpenAPI file as `api/openapi.json`) and the API tests run too.
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="https://unpkg.com/frontend-go-live-check@1/docs/terminal.png" alt="Terminal output: NOT READY, 2 blocker, 7 major, 5 minor, with a score per area" width="760">
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Why
|
|
52
|
+
|
|
53
|
+
| Without it | With it |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| "Looks fine on my screen" | Every page at phone, tablet and desktop size, in a real browser |
|
|
56
|
+
| Accessibility, security and speed are checked by different people, if at all | One run, one report, one verdict: **READY**, **NEEDS ATTENTION** or **NOT READY** |
|
|
57
|
+
| Bugs reported as "the page is broken" | A picture of the problem outlined in red, the CSS selector, steps to see it, and how to fix it |
|
|
58
|
+
| Writing and maintaining end-to-end tests for every page | Nothing to write: pages are found by following links, your routes and your sitemap |
|
|
59
|
+
| Releases go out on hope | A pipeline step that **blocks the merge** when there are blocking problems |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Sign-in: email, Google, Microsoft, UAE PASS…
|
|
64
|
+
|
|
65
|
+
> ### ⚠️ Read this first: sign-in decides what gets tested
|
|
66
|
+
> Most of an app is behind its sign-in. **If the tool can't sign in, only the public pages are tested**, and the report says so: *"Signed-in pages were not tested"*.
|
|
67
|
+
>
|
|
68
|
+
> The tool **finds every sign-in method by itself**: email and password, Google, Microsoft, Apple, UAE PASS, or any OpenID Connect server.
|
|
69
|
+
>
|
|
70
|
+
> It **never signs in with a real Google or UAE PASS account on its own.** Those sign-ins block automated browsers or need approval on a phone, and automating them would break their rules. Instead you choose one of the ways below. It takes a minute.
|
|
71
|
+
|
|
72
|
+
### How the tool signs in
|
|
73
|
+
|
|
74
|
+
| Your app signs in with | On your computer | In the pipeline (`ciLogin`) |
|
|
75
|
+
| --- | --- | --- |
|
|
76
|
+
| **Email or user name + password** | Automatic: set `login` with a **test** account | The same, with the password from a pipeline secret |
|
|
77
|
+
| **Google · Microsoft · Apple** | Run `npx frontend-go-live-check login` **once** and sign in by hand in the window that opens; the session is saved and reused | A test sign-in on the **test environment** (see below), or a test token |
|
|
78
|
+
| **UAE PASS** | The same: sign in once with a **UAE PASS staging** test account and approve on your phone | A test sign-in on the test environment, or a test token: never a real UAE PASS account |
|
|
79
|
+
| **Several of these** | Pick one for the test run; every sign-in button is still checked (below) | The same |
|
|
80
|
+
|
|
81
|
+
**Email and password**: the tool finds the fields and the button itself, including two-step forms and Arabic buttons.
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
"login": { "page": "/login", "username": "test.user@example.com", "password": "$GO_LIVE_PASSWORD" }
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Google, Microsoft, Apple, UAE PASS**: sign in once by hand, then every run reuses that session.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx frontend-go-live-check login
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
"login": { "method": "session", "page": "/login" }
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
What happens:
|
|
98
|
+
|
|
99
|
+
- A normal browser window opens on your app. Sign in the way your users do (approve UAE PASS on your phone), wait for a signed-in page, then press Enter in the terminal.
|
|
100
|
+
- The session (cookies and browser storage) is saved in **`go-live-check.session.json`**. Treat it like a password: Git ignores it, never share it.
|
|
101
|
+
- When it expires, the report says ***"The saved sign-in session has expired"*** (also when the app's API starts answering 401), and `doctor` tells you before you run. Run `login` again.
|
|
102
|
+
|
|
103
|
+
**Pipelines (`ciLogin`)**: a pipeline has no one to approve a sign-in, so it uses `ciLogin` instead of `login`. Pick one of these:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
"ciLogin": { "page": "/login", "username": "ci.test@example.com", "password": "$CI_TEST_PASSWORD" }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
"ciLogin": { "method": "token", "token": { "header": "Bearer $CI_TEST_TOKEN" } }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
- **Test sign-in (recommended):** the test environment offers a test email/password sign-in, or a mock identity provider (Keycloak, a mock OpenID Connect server). Never offer it in production.
|
|
114
|
+
- **Test token:** a token for a test user, from a pipeline secret. `token` can also set `cookies`, `localStorage` or `sessionStorage` values, wherever your app keeps its token. The header is only sent to your app, never to other sites.
|
|
115
|
+
|
|
116
|
+
### Every sign-in button is checked, whatever it says
|
|
117
|
+
|
|
118
|
+
The tool finds Google, Microsoft, Apple, Facebook, GitHub, LinkedIn, **UAE PASS**, Auth0, Okta, Cognito and any OpenID Connect server. The button can say anything, *"Use Google"*, *"Continue"*, Arabic text, or show only an icon. It uses four signals:
|
|
119
|
+
|
|
120
|
+
1. the button's text, label or logo;
|
|
121
|
+
2. **where a click leads**: every button on the sign-in page is clicked in a throwaway window, and the provider address is caught and **stopped**, so Google and UAE PASS are never contacted;
|
|
122
|
+
3. the provider's script on the page;
|
|
123
|
+
4. sign-in libraries in your code (Auth.js, MSAL, Firebase, Keycloak, oidc-client…).
|
|
124
|
+
|
|
125
|
+
| Checked | Why it matters |
|
|
126
|
+
| --- | --- |
|
|
127
|
+
| The button starts a sign-in | A dead *"Sign in with UAE PASS"* button locks users out |
|
|
128
|
+
| HTTPS | Sign-in data must never travel unencrypted |
|
|
129
|
+
| `state` is sent | Protects against forged sign-ins (CSRF) |
|
|
130
|
+
| Code flow with **PKCE**, not the old token flow | The current OAuth security best practice |
|
|
131
|
+
| The return address (`redirect_uri`) is HTTPS and yours | The user and the code must come back to your app |
|
|
132
|
+
| **UAE PASS environment**: staging (`stg-id.uaepass.ae`) or production (`id.uaepass.ae`), and `acr_values` | Production must never point at staging |
|
|
133
|
+
| **Cancelled sign-in**: your return page with `error=access_denied` | Users who press *Cancel* must see a clear message, not a crash or a blank page |
|
|
134
|
+
|
|
135
|
+
The report lists every sign-in method found (*email and password · Google · UAE PASS (staging)*), and the PDF and Word files include it.
|
|
136
|
+
|
|
137
|
+
> **💡 Before going live:** sign in once by hand with each real provider on the production site. No automated tool can do that last step for you.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## What it checks
|
|
142
|
+
|
|
143
|
+
| | Area | What is checked |
|
|
144
|
+
| :-: | --- | --- |
|
|
145
|
+
| 🧭 | **Functionality** | JavaScript errors, console errors, failed requests, broken links, images and anchors, blank pages, the production build, the "page not found" page |
|
|
146
|
+
| 🛟 | **Resilience** | Each page opened again with its API calls failing: does it crash, go blank, or tell the user? |
|
|
147
|
+
| 📱 | **Design and responsive layout** | Every page at every screen size: sideways scrolling, cut-off or overlapping text and buttons, tiny text on phones, right-to-left layout (Arabic, Hebrew…), fonts that fail to load, too many fonts and sizes |
|
|
148
|
+
| 🖼️ | **Visual changes** | A pixel comparison of every page with the saved baseline, with the changed areas in red |
|
|
149
|
+
| ♿ | **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 |
|
|
150
|
+
| ⚡ | **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 |
|
|
151
|
+
| 🔌 | **API calls made by the pages** | Slow, very large, repeated, too many, uncompressed or uncached calls |
|
|
152
|
+
| 📈 | **Load** | 10 users at the same time on the main pages and the app's own read requests |
|
|
153
|
+
| 🔐 | **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 |
|
|
154
|
+
| 🧪 | **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 |
|
|
155
|
+
| 🛡️ | **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` |
|
|
156
|
+
| 🔎 | **SEO and sharing** | Titles, descriptions, headings, language, duplicate titles, favicon, link previews, robots.txt and sitemap.xml |
|
|
157
|
+
| 🧹 | **Code** | TypeScript errors, your own ESLint rules, leftover `console.log` |
|
|
158
|
+
|
|
159
|
+
The report's **What was checked** table says exactly what ran on your project, and why anything was skipped.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Works with
|
|
164
|
+
|
|
165
|
+
**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`.
|
|
166
|
+
|
|
167
|
+
The framework and the package manager (npm, pnpm, yarn, bun) are detected. The app is built and started **the way it runs in production**.
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><b>How each framework is started</b></summary>
|
|
171
|
+
|
|
172
|
+
| Project | Started for the check with |
|
|
173
|
+
| --- | --- |
|
|
174
|
+
| Next.js | `next build` → `next start` (static export: the `out/` folder) |
|
|
175
|
+
| React / Vue / Svelte / Solid with Vite | build → `vite preview` (keeps your preview proxy to the API) |
|
|
176
|
+
| Create React App, Vue CLI, Parcel, webpack, Gatsby | build → the output folder |
|
|
177
|
+
| Nuxt | build → `.output/server` (or `.output/public`) |
|
|
178
|
+
| Angular | `ng build` → `dist/<app>/browser` |
|
|
179
|
+
| SvelteKit | build → `node build`, `build/` or `vite preview` |
|
|
180
|
+
| Astro | build → `dist/` or the Node adapter's server |
|
|
181
|
+
| Remix / React Router 7 | build → `npm start` |
|
|
182
|
+
| Plain HTML | the folder itself |
|
|
183
|
+
| Anything else | `"start": "your command"` in the settings, or `--url https://your-test-site` |
|
|
184
|
+
|
|
185
|
+
</details>
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## The report
|
|
190
|
+
|
|
191
|
+
<p align="center">
|
|
192
|
+
<img src="https://unpkg.com/frontend-go-live-check@1/docs/overview.png" alt="The HTML report: share bar, verdict and a score per area" width="900">
|
|
193
|
+
</p>
|
|
194
|
+
|
|
195
|
+
The report has:
|
|
196
|
+
|
|
197
|
+
- the **verdict** and a **score per area** (click an area to filter);
|
|
198
|
+
- every problem, with where it is and at which screen sizes;
|
|
199
|
+
- the API results, the speed of every page, and the load test;
|
|
200
|
+
- screenshots of every page at every size.
|
|
201
|
+
|
|
202
|
+
### Every problem comes with evidence
|
|
203
|
+
|
|
204
|
+
The page is shown at the screen size where the problem happens, with the problem **outlined in red**. Each problem also lists the element's CSS selector, the steps to see it, and how to fix it.
|
|
205
|
+
|
|
206
|
+
<p align="center">
|
|
207
|
+
<img src="https://unpkg.com/frontend-go-live-check@1/docs/finding.png" alt="A finding with its evidence picture: the clickable box is outlined in red" width="820">
|
|
208
|
+
</p>
|
|
209
|
+
|
|
210
|
+
### Share it as PDF or Word
|
|
211
|
+
|
|
212
|
+
The **Share this report** bar downloads:
|
|
213
|
+
|
|
214
|
+
- **PDF**, to read, print or attach to an email;
|
|
215
|
+
- **Word**, for comments and sign-off;
|
|
216
|
+
- **Everything (.zip)**, the full report with all screenshots.
|
|
217
|
+
|
|
218
|
+
Both documents follow a standard test-report layout:
|
|
219
|
+
|
|
220
|
+
- a cover and document control;
|
|
221
|
+
- a review-and-approval table;
|
|
222
|
+
- contents;
|
|
223
|
+
- an executive summary;
|
|
224
|
+
- results by area;
|
|
225
|
+
- every finding with an ID, its evidence and how to fix it;
|
|
226
|
+
- problems per page;
|
|
227
|
+
- a fix checklist;
|
|
228
|
+
- appendices with screenshots.
|
|
229
|
+
|
|
230
|
+
<p align="center">
|
|
231
|
+
<img src="https://unpkg.com/frontend-go-live-check@1/docs/documents.png" alt="The PDF: cover, executive summary, and a finding with its evidence" width="900">
|
|
232
|
+
</p>
|
|
233
|
+
|
|
234
|
+
| Verdict | When |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| ✖ **NOT READY** | at least one **blocker** |
|
|
237
|
+
| ⚠ **NEEDS ATTENTION** | no blockers, at least one **major** problem |
|
|
238
|
+
| ✔ **READY** | no blockers and no major problems |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Pipelines: approve or reject the merge
|
|
243
|
+
|
|
244
|
+
One command writes a ready-to-use pipeline file. It runs the full check on every pull or merge request, and the run **fails when there are blockers**. Make the check *required*, and the merge is blocked until they are fixed.
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
npx frontend-go-live-check ci gitlab
|
|
248
|
+
npx frontend-go-live-check ci github
|
|
249
|
+
npx frontend-go-live-check ci azure
|
|
250
|
+
npx frontend-go-live-check ci bitbucket
|
|
251
|
+
npx frontend-go-live-check ci jenkins
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
| Provider | File | Where the result shows |
|
|
255
|
+
| --- | --- | --- |
|
|
256
|
+
| GitLab CI | `.gitlab/go-live-check.gitlab-ci.yml` | merge request test report and artifacts |
|
|
257
|
+
| GitHub Actions | `.github/workflows/go-live-check.yml` | a check plus a summary comment on the pull request |
|
|
258
|
+
| Azure DevOps | `azure-pipelines.go-live-check.yml` | Tests tab, build summary, report artifact |
|
|
259
|
+
| Bitbucket | `bitbucket-pipelines.go-live-check.yml` | pull request build status and artifacts |
|
|
260
|
+
| Jenkins | `Jenkinsfile.go-live-check` | test results and archived report |
|
|
261
|
+
|
|
262
|
+
The top of each file says:
|
|
263
|
+
|
|
264
|
+
- which secrets to add (the `$NAMES` from your settings);
|
|
265
|
+
- how to make the check required.
|
|
266
|
+
|
|
267
|
+
Use `"failOn": "major"` for stricter merges.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Commands
|
|
272
|
+
|
|
273
|
+
| Command | What it does |
|
|
274
|
+
| --- | --- |
|
|
275
|
+
| `frontend-go-live-check` | The full check of the project in this folder |
|
|
276
|
+
| `frontend-go-live-check --quick` | A fast check while you work: desktop and phone, no Lighthouse, load test or visual comparison |
|
|
277
|
+
| `frontend-go-live-check --url <address>` | Check a site that is already running (a test server, any technology) |
|
|
278
|
+
| `frontend-go-live-check init` | Set the project up: scripts, settings, `.gitignore`, test browser |
|
|
279
|
+
| `frontend-go-live-check login` | Sign in once by hand (Google, UAE PASS…); the session is saved and reused |
|
|
280
|
+
| `frontend-go-live-check doctor` | Check that everything is ready; changes nothing |
|
|
281
|
+
| `frontend-go-live-check plan` | List every API test case; calls nothing |
|
|
282
|
+
| `frontend-go-live-check export` | Write the PDF and Word files again from the last report |
|
|
283
|
+
| `frontend-go-live-check ci <provider>` | Add a pipeline that gates the merge |
|
|
284
|
+
|
|
285
|
+
The short name `go-live-check` works too. After `init`, use `npm run go-live`, `npm run go-live:quick` and `npm run go-live:api`.
|
|
286
|
+
|
|
287
|
+
<details>
|
|
288
|
+
<summary><b>All options</b></summary>
|
|
289
|
+
|
|
290
|
+
| Option | What it does |
|
|
291
|
+
| --- | --- |
|
|
292
|
+
| `--only pages,security` | Only these areas: `pages`, `lighthouse`, `auth`, `security`, `resilience`, `load`, `api`, `code` |
|
|
293
|
+
| `--skip lighthouse,load` | Everything except these |
|
|
294
|
+
| `--api-only` | Only the API tests (backend projects) |
|
|
295
|
+
| `--api <file or URL>` | The Postman collection or OpenAPI/Swagger file (found automatically in the project) |
|
|
296
|
+
| `--pages /,/about` | Where to start looking for pages |
|
|
297
|
+
| `--max-pages <n>` | Stop after this many pages (default 50) |
|
|
298
|
+
| `--viewports phone,desktop` | `small-phone` 320 · `phone` 390 · `tablet` 768 · `laptop` 1280 · `desktop` 1440 · `wide` 1920 |
|
|
299
|
+
| `--all-browsers` | Also Firefox and Safari (WebKit) |
|
|
300
|
+
| `--no-lighthouse` · `--no-build` · `--no-export` | Skip Lighthouse · use the existing build · no PDF/Word |
|
|
301
|
+
| `--format pdf` | Only one of the documents |
|
|
302
|
+
| `--update-baseline` | Save the current look of every page as the new design baseline |
|
|
303
|
+
| `--fail-on major` | What fails the command: `blocker` (default) · `major` · `minor` · `never` |
|
|
304
|
+
| `--open` · `--out <folder>` · `--config <file>` · `--quiet` · `--ci` | Open the report · report folder · settings file · less output · pipeline mode |
|
|
305
|
+
|
|
306
|
+
</details>
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Settings
|
|
311
|
+
|
|
312
|
+
Everything is optional. `init` writes `go-live-check.config.json`, and your editor autocompletes it through `$schema`.
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"$schema": "./node_modules/frontend-go-live-check/schema.json",
|
|
317
|
+
"login": { "page": "/login", "username": "test.user", "password": "$GO_LIVE_PASSWORD" },
|
|
318
|
+
"services": [{ "command": "npm run api", "url": "http://localhost:4000/health" }],
|
|
319
|
+
"failOn": "blocker"
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
API tests need no settings when your files are in `api/` ([see API tests](#settings)). Passwords are written as `"$NAME"`. Put their values in `go-live-check.env` (Git ignores it) or in your pipeline's secrets. They are replaced with `‹secret›` in every report.
|
|
324
|
+
|
|
325
|
+
<details>
|
|
326
|
+
<summary><b>🔐 Sign-in forms that need help</b></summary>
|
|
327
|
+
|
|
328
|
+
All the sign-in methods are explained in [Sign-in](#sign-in-email-google-microsoft-uae-pass). Most sign-in forms work with only `page`, `username` and `password`. The check finds the password field, the user name field before it, and the button (English and Arabic texts are recognised). Two-step forms (user name, *Next*, then password) work too.
|
|
329
|
+
|
|
330
|
+
For an unusual page, name each part by its label, placeholder, field name, or a CSS selector written as `css=…`:
|
|
331
|
+
|
|
332
|
+
```json
|
|
333
|
+
"login": {
|
|
334
|
+
"page": "/auth/sign-in",
|
|
335
|
+
"username": "test.user",
|
|
336
|
+
"password": "$GO_LIVE_PASSWORD",
|
|
337
|
+
"usernameField": "Email or ID",
|
|
338
|
+
"passwordField": "css=#pwd",
|
|
339
|
+
"submit": "Continue",
|
|
340
|
+
"fields": { "Organisation": "Test organisation" },
|
|
341
|
+
"expect": "/dashboard"
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
An external single sign-on page usually can't be automated. Point `login` at a test environment's sign-in page.
|
|
346
|
+
|
|
347
|
+
</details>
|
|
348
|
+
|
|
349
|
+
<details>
|
|
350
|
+
<summary><b>🧪 API tests from Postman or OpenAPI</b></summary>
|
|
351
|
+
|
|
352
|
+
Put your API description in an **`api/`** folder at the root of your project, with **exactly these names**:
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
my-project/
|
|
356
|
+
├── api/
|
|
357
|
+
│ ├── postman_collection.json ← the Postman collection (v2.1)
|
|
358
|
+
│ ├── postman_environment.json ← optional: its environment ({{baseUrl}} and other variables)
|
|
359
|
+
│ └── openapi.json ← or/and the OpenAPI / Swagger file (openapi.yaml works too)
|
|
360
|
+
├── go-live-check.config.json
|
|
361
|
+
└── package.json
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
That's all: no settings are needed. Postman export names (`My API.postman_collection.json`) need renaming to `postman_collection.json`. If both a Postman collection and an OpenAPI file are there, they are combined: OpenAPI gives the rules, Postman the examples. `init` creates `api/README.md` with these instructions. `frontend-go-live-check doctor` shows what it found.
|
|
365
|
+
|
|
366
|
+
Never put real passwords or tokens in these files: use `$NAMES` (see below).
|
|
367
|
+
|
|
368
|
+
To test roles and ownership, add test users. Include a **second user of the same role**, so the check can test that users can't read each other's records:
|
|
369
|
+
|
|
370
|
+
```json
|
|
371
|
+
"api": {
|
|
372
|
+
"baseUrl": "http://localhost:4000",
|
|
373
|
+
"users": {
|
|
374
|
+
"user": { "username": "user.one", "password": "$USER_PASSWORD", "role": "user" },
|
|
375
|
+
"user2": { "username": "user.two", "password": "$USER2_PASSWORD", "role": "user" },
|
|
376
|
+
"admin": { "username": "admin.test", "password": "$ADMIN_PASSWORD", "role": "admin" }
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
**Test data.** It is generated from the schema (or from your Postman examples). Records the run creates are tagged and deleted afterwards.
|
|
382
|
+
|
|
383
|
+
**Writes.** POST, PUT, PATCH and DELETE happen only on `localhost` or on hosts you list in `api.writeHosts`.
|
|
384
|
+
|
|
385
|
+
**Before you run.** `frontend-go-live-check plan` lists every case without calling anything.
|
|
386
|
+
|
|
387
|
+
</details>
|
|
388
|
+
|
|
389
|
+
<details>
|
|
390
|
+
<summary><b>🖼️ Visual changes</b></summary>
|
|
391
|
+
|
|
392
|
+
The first run saves a picture of every page at every size in `go-live-baseline/`. Commit that folder. Later runs report pages that look different, with the changed areas in red.
|
|
393
|
+
|
|
394
|
+
After an intended design change, save the new look:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
npx frontend-go-live-check --update-baseline
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
Hide parts that change on their own (clocks, live data) with `"visualMask": [".clock"]`.
|
|
401
|
+
|
|
402
|
+
</details>
|
|
403
|
+
|
|
404
|
+
<details>
|
|
405
|
+
<summary><b>📋 All settings</b></summary>
|
|
406
|
+
|
|
407
|
+
| Key | Meaning |
|
|
408
|
+
| --- | --- |
|
|
409
|
+
| `pages`, `maxPages`, `routeParams` | Where to start; how many pages; values for routes like `/orders/:id` (`{ "id": "1" }`) |
|
|
410
|
+
| `publicPages`, `publicApis` | Pages and APIs meant to open without signing in (pages linked from the sign-in page count automatically) |
|
|
411
|
+
| `viewports`, `browsers` | Screen sizes (names or `{ "name", "width", "height", "mobile" }`); `chromium`, `firefox`, `webkit` |
|
|
412
|
+
| `services` | Commands started first (a backend, a mock API), each ready when its `url` answers |
|
|
413
|
+
| `build`, `start`, `url` | `false` or your own build command · your own start command (`{port}` / `$PORT`) · check a running site |
|
|
414
|
+
| `budgets` | `pageKB` 3000 · `jsKB` 1000 · `requests` 120 · `loadMs` 4000 · `apiMs` 1000 · `apiCalls` 30 |
|
|
415
|
+
| `load` | `{ "users": 10, "seconds": 10, "maxTargets": 8, "hosts": [] }`, or `false` (GET only; this computer or listed hosts) |
|
|
416
|
+
| `keyboard`, `resilience`, `visual`, `evidence`, `formChecks`, `lighthouse`, `discoverRoutes` | All on by default; `false` turns one off |
|
|
417
|
+
| `visualThreshold`, `visualMask`, `baselineDir` | How much may change (0.1%); parts to hide; where the baseline lives |
|
|
418
|
+
| `report` | `organisation`, `classification` (default *Internal*), `preparedFor`, `approvers`: shown in the PDF and Word |
|
|
419
|
+
| `export` | `["pdf", "docx"]` (default) or `false` |
|
|
420
|
+
| `failOn` | `blocker` (default) · `major` · `minor` · `never` |
|
|
421
|
+
| `login` | `page`, `username`, `password` (email/password) · `"method": "session"` (after `login`) · `"method": "token"` with `token` · `usernameField`, `passwordField`, `submit`, `fields`, `expect` |
|
|
422
|
+
| `ciLogin` | Replaces `login` in pipelines: a test sign-in or a test token |
|
|
423
|
+
|
|
424
|
+
</details>
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## Safety and privacy
|
|
429
|
+
|
|
430
|
+
- **Everything runs on your machine** or your own pipeline. Nothing is sent anywhere except to the app being tested.
|
|
431
|
+
- **Test passwords** come from `go-live-check.env` or pipeline secrets, and never appear in a report or log.
|
|
432
|
+
- **Use test accounts on a test environment.** Browser checks only read pages and submit forms empty.
|
|
433
|
+
- **API writes and the load test** run only against this computer or the hosts you list. Every record the tests create is deleted afterwards.
|
|
434
|
+
- **Closed networks.** Point `PLAYWRIGHT_DOWNLOAD_HOST` at your mirror, or `GO_LIVE_CHROMIUM` at an existing Chromium.
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Use it from code
|
|
439
|
+
|
|
440
|
+
```js
|
|
441
|
+
import { goLiveCheck } from 'frontend-go-live-check';
|
|
442
|
+
|
|
443
|
+
const { summary, failed } = await goLiveCheck({ dir: process.cwd(), quick: true, quiet: true });
|
|
444
|
+
console.log(summary.verdict); // READY · NEEDS ATTENTION · NOT READY
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## FAQ
|
|
450
|
+
|
|
451
|
+
<details>
|
|
452
|
+
<summary><b>Does it replace unit and end-to-end tests?</b></summary>
|
|
453
|
+
|
|
454
|
+
No. It checks what every web app needs before going live, without any test code. Your own tests still cover your business rules.
|
|
455
|
+
|
|
456
|
+
</details>
|
|
457
|
+
|
|
458
|
+
<details>
|
|
459
|
+
<summary><b>How long does a run take?</b></summary>
|
|
460
|
+
|
|
461
|
+
About 2 minutes for a small app with Lighthouse. `--quick` takes under a minute. Bigger apps take longer, depending on the number of pages (`maxPages`) and screen sizes.
|
|
462
|
+
|
|
463
|
+
</details>
|
|
464
|
+
|
|
465
|
+
<details>
|
|
466
|
+
<summary><b>Why are header findings marked "local server"?</b></summary>
|
|
467
|
+
|
|
468
|
+
Security headers, compression and caching usually come from your web server or CDN, not from the app. On a local run they are information only. Check a test environment with `--url` for the real values.
|
|
469
|
+
|
|
470
|
+
</details>
|
|
471
|
+
|
|
472
|
+
<details>
|
|
473
|
+
<summary><b>What still needs a person?</b></summary>
|
|
474
|
+
|
|
475
|
+
- whether the design matches what was intended (the screenshots make this quick);
|
|
476
|
+
- business rules;
|
|
477
|
+
- a full load test before a big launch;
|
|
478
|
+
- a penetration test.
|
|
479
|
+
|
|
480
|
+
</details>
|
|
481
|
+
|
|
482
|
+
<details>
|
|
483
|
+
<summary><b>Troubleshooting</b></summary>
|
|
484
|
+
|
|
485
|
+
| You see | Fix |
|
|
486
|
+
| --- | --- |
|
|
487
|
+
| `Executable doesn't exist` | `npx playwright install chromium` |
|
|
488
|
+
| `Not set: GO_LIVE_PASSWORD` | Copy `go-live-check.env.example` to `go-live-check.env` and fill it in |
|
|
489
|
+
| `login-failed` | Check `login`; name the fields (`usernameField`, `passwordField`, `submit`) if the form is unusual |
|
|
490
|
+
| *Signed-in pages were not tested* | Set `login`, or run `npx frontend-go-live-check login` (Google, UAE PASS…) |
|
|
491
|
+
| *The saved sign-in session has expired* | Run `npx frontend-go-live-check login` again |
|
|
492
|
+
| `start-failed` | Run the build and start yourself and fix the error, set `start`, or use `--url` |
|
|
493
|
+
| A public page "opens without signing in" | Add it to `publicPages` |
|
|
494
|
+
| Many visual changes after a font or OS change | `--update-baseline` (create baselines on the same kind of machine that compares) |
|
|
495
|
+
| `EBADENGINE` | Node.js 22.19 or newer is needed |
|
|
496
|
+
|
|
497
|
+
</details>
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
<p align="center">
|
|
502
|
+
<b>Requirements:</b> Node.js 22.19+ · <b>License:</b> MIT · <a href="https://unpkg.com/frontend-go-live-check@1/CHANGELOG.md">Changelog</a>
|
|
503
|
+
</p>
|
package/docs/banner.jpg
ADDED
|
Binary file
|
|
Binary file
|
package/docs/finding.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|