@activate-core/test-forge 1.0.2 → 1.0.3
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.
|
@@ -310,7 +310,7 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath, transpor
|
|
|
310
310
|
` Locate inside the journey's form/container, never page-wide by a`,
|
|
311
311
|
` bare id or label that another always-mounted component also uses.`,
|
|
312
312
|
`(15) NOTHING YOU ARE NOT TESTING MAY BLOCK YOU. Apps open their own`,
|
|
313
|
-
` pop-ups for a signed-in or new user (
|
|
313
|
+
` pop-ups for a signed-in or new user (promotions, cookie consent,`,
|
|
314
314
|
` onboarding tips, notification prompts). Use the harness's login /`,
|
|
315
315
|
` storage helpers that pre-suppress them; if one still opens, close it`,
|
|
316
316
|
` before you continue. A click intercepted by an overlay the test is`,
|
|
@@ -183,50 +183,52 @@ export const HARNESS_CONTRACT = [
|
|
|
183
183
|
` cases pending — never assert a scope the token cannot actually prove.`,
|
|
184
184
|
``,
|
|
185
185
|
`RUN ENVIRONMENT — the suite must run on a fresh machine given only the`,
|
|
186
|
-
`env file
|
|
187
|
-
`
|
|
188
|
-
`
|
|
189
|
-
`
|
|
190
|
-
`
|
|
191
|
-
` <name> — run: npm i -D <name>"
|
|
192
|
-
`
|
|
193
|
-
` before the suite starts
|
|
194
|
-
`
|
|
195
|
-
`
|
|
196
|
-
`
|
|
197
|
-
`
|
|
198
|
-
` -
|
|
199
|
-
`
|
|
200
|
-
`
|
|
201
|
-
`
|
|
202
|
-
`
|
|
203
|
-
`
|
|
204
|
-
`
|
|
205
|
-
`
|
|
206
|
-
`
|
|
186
|
+
`env file, in WHATEVER stack this project uses. Decide everything below`,
|
|
187
|
+
`from what you read in THIS project; nothing here names a stack.`,
|
|
188
|
+
` - PACKAGES: use Node built-ins, the test runner, and what the project`,
|
|
189
|
+
` already has installed. If reaching the project's data layer needs a`,
|
|
190
|
+
` client the project lacks (a driver for its database), require it`,
|
|
191
|
+
` lazily, throw "testkit: missing package <name> — run: npm i -D <name>"`,
|
|
192
|
+
` when absent, and list it in REQUIRED_PACKAGES (an array literal) so`,
|
|
193
|
+
` the runner can check before the suite starts. Never add a package`,
|
|
194
|
+
` for anything else.`,
|
|
195
|
+
` - NO OTHER RUNTIMES: never shell out to another language runtime, a`,
|
|
196
|
+
` framework CLI or a container tool — the test machine need not have`,
|
|
197
|
+
` them.`,
|
|
198
|
+
` - CREDENTIALS COME FROM THE ENV FILE: every role the suite logs in as`,
|
|
199
|
+
` (customer, staff, admin, second customer, …) is an account whose`,
|
|
200
|
+
` login identifier and password are read from the env file`,
|
|
201
|
+
` (TEST_<ROLE>_EMAIL / TEST_<ROLE>_PASSWORD, or the identifier the app`,
|
|
202
|
+
` logs in with). The testkit NEVER hashes or invents a password. The`,
|
|
203
|
+
` seed may fill in the profile data such an account needs (addresses,`,
|
|
204
|
+
` vehicles, settings) but never its credential.`,
|
|
205
|
+
` - EXTRA ACCOUNT STATES (unverified, banned, deleted, another role, an`,
|
|
206
|
+
` expired credential): create them the way the app itself would —`,
|
|
207
|
+
` through its API where one exists, otherwise through the data layer`,
|
|
208
|
+
` by COPYING the stored credential of an env-provided account onto the`,
|
|
209
|
+
` new record, then setting the state. Never compute a credential.`,
|
|
210
|
+
` - SEED THE DATA TESTS NEED: codes, links, other customers' records —`,
|
|
211
|
+
` seeded and exposed through TEST_IDS and the env setup() publishes,`,
|
|
212
|
+
` so in auto mode no test waits on hand-made data. DB assertions (rows`,
|
|
213
|
+
` created, state persisted) go through the same data-layer client.`,
|
|
207
214
|
` - LOG IN ONCE: mint each role's token once per run (globalSetup) and`,
|
|
208
|
-
` reuse
|
|
209
|
-
`
|
|
210
|
-
`
|
|
211
|
-
`
|
|
212
|
-
`
|
|
213
|
-
`
|
|
214
|
-
`
|
|
215
|
-
`
|
|
216
|
-
` onboarding, notification prompts) and have login(page) and any`,
|
|
217
|
-
` seeded browser storage pre-set the flags that suppress them, like a`,
|
|
218
|
-
` "prompt already shown" flag. Give the seeded user a first name so`,
|
|
219
|
-
` greetings render.`,
|
|
215
|
+
` reuse it; login(page) injects it. If the backend rate-limits and`,
|
|
216
|
+
` its limiter state lives in a store the testkit can reach in local`,
|
|
217
|
+
` mode, export resetRateLimits() that clears ONLY the limiter entries,`,
|
|
218
|
+
` gated exactly like reset(), and call it from setup().`,
|
|
219
|
+
` - SUPPRESS THE APP'S OWN POP-UPS: find, in the client, any dialog that`,
|
|
220
|
+
` opens by itself for a seeded role (promotions, consent, onboarding,`,
|
|
221
|
+
` permission prompts) and have login(page) and seeded browser storage`,
|
|
222
|
+
` pre-set the flags that suppress it.`,
|
|
220
223
|
` - VERIFICATION BYPASS (Playwright): when the app verifies by a code the`,
|
|
221
|
-
` test cannot read (
|
|
222
|
-
` bypassVerification(page, { url,
|
|
223
|
-
` \`url\` (the final verify/register call)
|
|
224
|
-
`
|
|
225
|
-
`
|
|
226
|
-
`
|
|
227
|
-
` the
|
|
228
|
-
`
|
|
229
|
-
` runs against the real backend.`,
|
|
224
|
+
` test cannot read (a code sent by message or email, a magic link, a`,
|
|
225
|
+
` third-party sign-in), export bypassVerification(page, { url, role }):`,
|
|
226
|
+
` route the request at \`url\` (the final verify/register call) and`,
|
|
227
|
+
` fulfil it with the app's REAL success response shape (read the`,
|
|
228
|
+
` server handler and the client that consumes it) carrying a REAL token`,
|
|
229
|
+
` for an env-provided account of that role, obtained through the real`,
|
|
230
|
+
` login. Only the code check is skipped; everything after it runs`,
|
|
231
|
+
` against the real backend.`,
|
|
230
232
|
``,
|
|
231
233
|
`CONNECTION LIFECYCLE — setup() must be safe to call repeatedly across`,
|
|
232
234
|
`suites, or one suite's teardown breaks the next (MongoNotConnectedError).`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "AI-powered QA automation. Scans a project, drafts journey docs, and generates seeded Jest/Playwright tests. Works in any project, with any AI CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|