@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 (referral/promo, cookie consent,`,
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. Every rule below exists because breaking it stopped a real run.`,
187
- ` - PACKAGES: use only Node built-ins, the test runner, and libraries the`,
188
- ` project already lists in package.json. If the data layer needs a`,
189
- ` driver or helper the project lacks (mysql2, pg, mongodb, bcryptjs),`,
190
- ` require it lazily and, when missing, throw "testkit: missing package`,
191
- ` <name> — run: npm i -D <name>". Also export REQUIRED_PACKAGES: an`,
192
- ` array literal naming every such package, so the runner can check them`,
193
- ` before the suite starts.`,
194
- ` - NO OTHER RUNTIMES: never shell out to php, python, artisan, docker or`,
195
- ` any CLI — the test machine need not have them. Hash a password in`,
196
- ` Node: bcrypt via bcryptjs, and for PHP/Laravel rewrite the "$2a$" /`,
197
- ` "$2b$" prefix to "$2y$" (the same algorithm).`,
198
- ` - THE SEED OWNS ITS CREDENTIALS: an account the seed CREATES gets a`,
199
- ` fixed test password constant that satisfies the app's password rule`,
200
- ` (e.g. 'QaTest#2026pass'), overridable by TEST_<ROLE>_PASSWORD. Never`,
201
- ` require env for a credential the seed itself sets.`,
202
- ` - SEED EVERYTHING A TEST NEEDS: special accounts (unverified, banned,`,
203
- ` soft-deleted, other roles, expired temporary passwords), codes`,
204
- ` (valid / expired / restricted coupons), shareable links, a second`,
205
- ` customer's records — all seeded and exposed through TEST_IDS and the`,
206
- ` env setup() publishes. In auto mode no test waits on hand-made data.`,
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 the cached token; login(page) injects it. Backends rate-limit`,
209
- ` by IP (e.g. 60 requests/minute) and a suite that calls the login API`,
210
- ` per test is throttled (HTTP 429). If the limiter's state lives in a`,
211
- ` store the testkit reaches in local mode (e.g. the backend's Redis`,
212
- ` cache), export resetRateLimits(): clear ONLY the limiter keys, gated`,
213
- ` exactly like reset(), and call it from setup().`,
214
- ` - SUPPRESS APP POP-UPS: read the client for pop-ups that open by`,
215
- ` themselves for the seeded roles (referral/promo, cookie consent,`,
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 (SMS/email OTP, magic link, OAuth), export`,
222
- ` bypassVerification(page, { url, account }): route the request at`,
223
- ` \`url\` (the final verify/register call); in the handler, seed the`,
224
- ` account (verified, with the given email/phone/name and the seed`,
225
- ` password), log it in through the REAL login API, and fulfil the`,
226
- ` intercepted request with the app's REAL success response shape (read`,
227
- ` the controller and the client that consumes it) carrying that real`,
228
- ` token and user. Only the code check is skipped — everything after it`,
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.2",
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": {