@activate-core/test-forge 0.10.0 → 0.10.2
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/dist/core/ai-generator.js +11 -0
- package/dist/core/harness.js +15 -1
- package/package.json +1 -1
|
@@ -136,6 +136,17 @@ export function buildPrompt(journey, map, testPath, focus, harnessPath) {
|
|
|
136
136
|
`in Playwright — using them throws at collection and breaks the`,
|
|
137
137
|
`WHOLE file. For a pending case use test.fixme(title, async () =>`,
|
|
138
138
|
`{}) or test.skip(...); group with test.describe(...).`,
|
|
139
|
+
`CRITICAL API-request API: the \`request\` FIXTURE (test args`,
|
|
140
|
+
`\`async ({ request }) => …\`) IS already an APIRequestContext —`,
|
|
141
|
+
`call it DIRECTLY: \`await request.post(url, { data })\`,`,
|
|
142
|
+
`\`await request.get(url)\`. It has NO \`.newContext()\`. Do NOT`,
|
|
143
|
+
`write \`request.newContext(...)\` — that throws "request.newContext`,
|
|
144
|
+
`is not a function". If you need a SEPARATE context with custom`,
|
|
145
|
+
`headers (e.g. a Bearer), import the request MODULE under a`,
|
|
146
|
+
`different name: \`import { request as apiRequest } from`,
|
|
147
|
+
`'@playwright/test'\` then \`const ctx = await`,
|
|
148
|
+
`apiRequest.newContext({ baseURL, extraHTTPHeaders })\`. Never call`,
|
|
149
|
+
`.newContext() on the fixture.`,
|
|
139
150
|
].join('\n'),
|
|
140
151
|
``,
|
|
141
152
|
...(testPath
|
package/dist/core/harness.js
CHANGED
|
@@ -59,7 +59,11 @@ export const HARNESS_CONTRACT = [
|
|
|
59
59
|
` - token(role?): string the current access token accessor`,
|
|
60
60
|
`Plus, for Playwright suites, ALSO export:`,
|
|
61
61
|
` - apiContext(request): a helper that returns an authed API request`,
|
|
62
|
-
` context (Bearer = the minted token — NEVER hardcode a secret)
|
|
62
|
+
` context (Bearer = the minted token — NEVER hardcode a secret).`,
|
|
63
|
+
` CRITICAL: create it from the imported request MODULE, NOT the`,
|
|
64
|
+
` fixture — \`const { request: apiRequest } = require('@playwright/`,
|
|
65
|
+
` test'); return apiRequest.newContext({ baseURL, extraHTTPHeaders })\`.`,
|
|
66
|
+
` The \`request\` FIXTURE has NO .newContext(); calling it throws.`,
|
|
63
67
|
` - login(page): Promise<void> drive/seed an authenticated UI session`,
|
|
64
68
|
`Use only env var NAMES for secrets/connection — never literal values.`,
|
|
65
69
|
`The ONLY credentials a developer should have to provide are the DB`,
|
|
@@ -98,6 +102,16 @@ function buildHarnessPrompt(harnessPath, framework) {
|
|
|
98
102
|
`exact names — the tests must run without any hand-pasted token.`,
|
|
99
103
|
``,
|
|
100
104
|
`This is a ${framework === 'jest' ? 'Jest/backend' : 'Playwright/UI'} area.`,
|
|
105
|
+
...(framework === 'jest'
|
|
106
|
+
? [
|
|
107
|
+
`Because this is a JEST/backend area, do NOT require or import`,
|
|
108
|
+
`'@playwright/test' anywhere (it is not installed in a backend`,
|
|
109
|
+
`package — a top-level require would break every suite that loads`,
|
|
110
|
+
`this testkit). OMIT the Playwright-only apiContext/login exports;`,
|
|
111
|
+
`backend suites make HTTP calls with supertest, not Playwright.`,
|
|
112
|
+
``,
|
|
113
|
+
]
|
|
114
|
+
: []),
|
|
101
115
|
HARNESS_CONTRACT,
|
|
102
116
|
``,
|
|
103
117
|
`The file will be saved at EXACTLY: ${harnessPath}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activate-core/test-forge",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
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": {
|