intellitester 0.2.15 → 0.2.18
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/{chunk-MRTD4FLN.js → chunk-EQJQS4RD.js} +159 -5
- package/dist/chunk-EQJQS4RD.js.map +1 -0
- package/dist/{chunk-UYGFHRPT.cjs → chunk-PL3IQXLK.cjs} +159 -5
- package/dist/chunk-PL3IQXLK.cjs.map +1 -0
- package/dist/cli/index.cjs +36 -35
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +28 -28
- package/dist/index.d.cts +160 -0
- package/dist/index.d.ts +160 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-MRTD4FLN.js.map +0 -1
- package/dist/chunk-UYGFHRPT.cjs.map +0 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkPL3IQXLK_cjs = require('../chunk-PL3IQXLK.cjs');
|
|
5
5
|
var chunkARJYJVRM_cjs = require('../chunk-ARJYJVRM.cjs');
|
|
6
6
|
require('../chunk-QMYM2TCH.cjs');
|
|
7
7
|
require('../chunk-PAKODOH4.cjs');
|
|
@@ -158,7 +158,7 @@ ${"=".repeat(60)}`);
|
|
|
158
158
|
}
|
|
159
159
|
let trackingServer = null;
|
|
160
160
|
try {
|
|
161
|
-
trackingServer = await
|
|
161
|
+
trackingServer = await chunkPL3IQXLK_cjs.startTrackingServer({ port: 0 });
|
|
162
162
|
console.log(`Tracking server started on port ${trackingServer.port}`);
|
|
163
163
|
} catch (error) {
|
|
164
164
|
console.warn("Failed to start tracking server:", error);
|
|
@@ -170,7 +170,7 @@ ${"=".repeat(60)}`);
|
|
|
170
170
|
let serverProcess = null;
|
|
171
171
|
if (pipeline.config?.webServer) {
|
|
172
172
|
try {
|
|
173
|
-
serverProcess = await
|
|
173
|
+
serverProcess = await chunkPL3IQXLK_cjs.startWebServer({
|
|
174
174
|
...pipeline.config.webServer,
|
|
175
175
|
cwd: pipelineDir
|
|
176
176
|
});
|
|
@@ -182,7 +182,7 @@ ${"=".repeat(60)}`);
|
|
|
182
182
|
}
|
|
183
183
|
const signalCleanup = async () => {
|
|
184
184
|
console.log("\n\nInterrupted - cleaning up...");
|
|
185
|
-
|
|
185
|
+
chunkPL3IQXLK_cjs.killServer(serverProcess);
|
|
186
186
|
if (trackingServer) await trackingServer.stop();
|
|
187
187
|
process.exit(1);
|
|
188
188
|
};
|
|
@@ -198,7 +198,7 @@ ${"=".repeat(60)}`);
|
|
|
198
198
|
variables: /* @__PURE__ */ new Map(),
|
|
199
199
|
lastEmail: null,
|
|
200
200
|
emailClient: null,
|
|
201
|
-
appwriteContext:
|
|
201
|
+
appwriteContext: chunkPL3IQXLK_cjs.createTestContext(),
|
|
202
202
|
appwriteConfig: pipeline.config?.appwrite ? {
|
|
203
203
|
endpoint: pipeline.config.appwrite.endpoint,
|
|
204
204
|
projectId: pipeline.config.appwrite.projectId,
|
|
@@ -206,7 +206,7 @@ ${"=".repeat(60)}`);
|
|
|
206
206
|
} : void 0
|
|
207
207
|
};
|
|
208
208
|
if (pipeline.config?.appwrite) {
|
|
209
|
-
|
|
209
|
+
chunkPL3IQXLK_cjs.setupAppwriteTracking(page, executionContext);
|
|
210
210
|
}
|
|
211
211
|
const completedIds = /* @__PURE__ */ new Set();
|
|
212
212
|
const failedIds = /* @__PURE__ */ new Set();
|
|
@@ -273,7 +273,7 @@ ${"=".repeat(40)}`);
|
|
|
273
273
|
console.log(`File: ${workflowRef.file}`);
|
|
274
274
|
console.log(`${"=".repeat(40)}`);
|
|
275
275
|
try {
|
|
276
|
-
const workflowDefinition = await
|
|
276
|
+
const workflowDefinition = await chunkPL3IQXLK_cjs.loadWorkflowDefinition(workflowFilePath);
|
|
277
277
|
if (workflowRef.variables) {
|
|
278
278
|
for (const [key, value] of Object.entries(workflowRef.variables)) {
|
|
279
279
|
const interpolated = value.replace(/\{\{(\w+)\}\}/g, (match, varName) => {
|
|
@@ -294,7 +294,7 @@ ${"=".repeat(40)}`);
|
|
|
294
294
|
sessionId,
|
|
295
295
|
testStartTime
|
|
296
296
|
};
|
|
297
|
-
const result = await
|
|
297
|
+
const result = await chunkPL3IQXLK_cjs.runWorkflowWithContext(
|
|
298
298
|
workflowDefinition,
|
|
299
299
|
workflowFilePath,
|
|
300
300
|
workflowOptions
|
|
@@ -431,7 +431,7 @@ ${"=".repeat(60)}`);
|
|
|
431
431
|
process.off("SIGTERM", signalCleanup);
|
|
432
432
|
await browserContext.close();
|
|
433
433
|
await browser.close();
|
|
434
|
-
|
|
434
|
+
chunkPL3IQXLK_cjs.killServer(serverProcess);
|
|
435
435
|
if (trackingServer) {
|
|
436
436
|
await trackingServer.stop();
|
|
437
437
|
}
|
|
@@ -1096,7 +1096,7 @@ function cleanYamlResponse(response) {
|
|
|
1096
1096
|
return cleaned;
|
|
1097
1097
|
}
|
|
1098
1098
|
async function generateTest(naturalLanguage, options) {
|
|
1099
|
-
const provider =
|
|
1099
|
+
const provider = chunkPL3IQXLK_cjs.createAIProvider(options.aiConfig);
|
|
1100
1100
|
let systemPrompt = SYSTEM_PROMPT;
|
|
1101
1101
|
if (options.source !== null) {
|
|
1102
1102
|
const sourceConfig = options.source ?? {};
|
|
@@ -1128,7 +1128,7 @@ Please fix the issue and generate valid YAML.`;
|
|
|
1128
1128
|
const yaml$1 = cleanYamlResponse(response);
|
|
1129
1129
|
lastYaml = yaml$1;
|
|
1130
1130
|
const parsed = yaml.parse(yaml$1);
|
|
1131
|
-
const validated =
|
|
1131
|
+
const validated = chunkPL3IQXLK_cjs.TestDefinitionSchema.parse(parsed);
|
|
1132
1132
|
return {
|
|
1133
1133
|
success: true,
|
|
1134
1134
|
test: validated,
|
|
@@ -1506,7 +1506,7 @@ var validateCommand = async (target) => {
|
|
|
1506
1506
|
throw new Error(`No YAML files found at ${absoluteTarget}`);
|
|
1507
1507
|
}
|
|
1508
1508
|
for (const file of files) {
|
|
1509
|
-
await
|
|
1509
|
+
await chunkPL3IQXLK_cjs.loadTestDefinition(file);
|
|
1510
1510
|
console.log(`\u2713 ${path4__namespace.default.relative(process2__default.default.cwd(), file)} valid`);
|
|
1511
1511
|
}
|
|
1512
1512
|
};
|
|
@@ -1523,8 +1523,8 @@ var runTestCommand = async (target, options) => {
|
|
|
1523
1523
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1524
1524
|
parsedConfig = parse2(configContent);
|
|
1525
1525
|
}
|
|
1526
|
-
const configMissing = parsedConfig ?
|
|
1527
|
-
const testMissing =
|
|
1526
|
+
const configMissing = parsedConfig ? chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1527
|
+
const testMissing = chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedTest);
|
|
1528
1528
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...testMissing])];
|
|
1529
1529
|
if (allMissing.length > 0) {
|
|
1530
1530
|
const projectRoot = await findProjectRoot(absoluteTarget);
|
|
@@ -1533,8 +1533,8 @@ var runTestCommand = async (target, options) => {
|
|
|
1533
1533
|
process2__default.default.exit(1);
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
|
-
const test = await
|
|
1537
|
-
const config = hasConfigFile ? await
|
|
1536
|
+
const test = await chunkPL3IQXLK_cjs.loadTestDefinition(absoluteTarget);
|
|
1537
|
+
const config = hasConfigFile ? await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1538
1538
|
const baseUrl = resolveBaseUrl(test, config?.platforms?.web?.baseUrl);
|
|
1539
1539
|
const headed = options.headed ?? false;
|
|
1540
1540
|
const browser = options.browser ?? "chromium";
|
|
@@ -1548,7 +1548,7 @@ var runTestCommand = async (target, options) => {
|
|
|
1548
1548
|
console.log(
|
|
1549
1549
|
`Running ${path4__namespace.default.basename(absoluteTarget)} on web (${browser}${modeFlags.length > 0 ? ", " + modeFlags.join(", ") : ""})`
|
|
1550
1550
|
);
|
|
1551
|
-
const result = await
|
|
1551
|
+
const result = await chunkPL3IQXLK_cjs.runWebTest(test, {
|
|
1552
1552
|
baseUrl,
|
|
1553
1553
|
headed,
|
|
1554
1554
|
browser,
|
|
@@ -1580,7 +1580,7 @@ var generateCommand = async (prompt, options) => {
|
|
|
1580
1580
|
const { parse: parse2 } = await import('yaml');
|
|
1581
1581
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1582
1582
|
const parsedConfig = parse2(configContent);
|
|
1583
|
-
const configMissing =
|
|
1583
|
+
const configMissing = chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedConfig);
|
|
1584
1584
|
if (configMissing.length > 0) {
|
|
1585
1585
|
const projectRoot = await findProjectRoot(CONFIG_FILENAME);
|
|
1586
1586
|
const canContinue = await validateEnvVars(configMissing, projectRoot || process2__default.default.cwd());
|
|
@@ -1588,7 +1588,7 @@ var generateCommand = async (prompt, options) => {
|
|
|
1588
1588
|
process2__default.default.exit(1);
|
|
1589
1589
|
}
|
|
1590
1590
|
}
|
|
1591
|
-
const config = await
|
|
1591
|
+
const config = await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
|
|
1592
1592
|
if (!config.ai) {
|
|
1593
1593
|
throw new Error('AI configuration missing in intellitester.config.yaml. Add "ai:" section with provider, model, and apiKey.');
|
|
1594
1594
|
}
|
|
@@ -1633,8 +1633,8 @@ var runWorkflowCommand = async (file, options) => {
|
|
|
1633
1633
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1634
1634
|
parsedConfig = parse2(configContent);
|
|
1635
1635
|
}
|
|
1636
|
-
const configMissing = parsedConfig ?
|
|
1637
|
-
const workflowMissing =
|
|
1636
|
+
const configMissing = parsedConfig ? chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1637
|
+
const workflowMissing = chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedWorkflow);
|
|
1638
1638
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...workflowMissing])];
|
|
1639
1639
|
if (allMissing.length > 0) {
|
|
1640
1640
|
const projectRoot = await findProjectRoot(workflowPath);
|
|
@@ -1643,14 +1643,15 @@ var runWorkflowCommand = async (file, options) => {
|
|
|
1643
1643
|
process2__default.default.exit(1);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
const workflow = await
|
|
1647
|
-
const config = hasConfigFile ? await
|
|
1648
|
-
const result = await
|
|
1646
|
+
const workflow = await chunkPL3IQXLK_cjs.loadWorkflowDefinition(workflowPath);
|
|
1647
|
+
const config = hasConfigFile ? await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1648
|
+
const result = await chunkPL3IQXLK_cjs.runWorkflow(workflow, workflowPath, {
|
|
1649
1649
|
headed: options.visible,
|
|
1650
1650
|
browser: options.browser,
|
|
1651
1651
|
interactive: options.interactive,
|
|
1652
1652
|
debug: options.debug,
|
|
1653
|
-
aiConfig: config?.ai
|
|
1653
|
+
aiConfig: config?.ai,
|
|
1654
|
+
webServer: config?.webServer
|
|
1654
1655
|
});
|
|
1655
1656
|
console.log(`
|
|
1656
1657
|
Workflow: ${workflow.name}`);
|
|
@@ -1690,8 +1691,8 @@ var runPipelineCommand = async (file, options) => {
|
|
|
1690
1691
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1691
1692
|
parsedConfig = parse2(configContent);
|
|
1692
1693
|
}
|
|
1693
|
-
const configMissing = parsedConfig ?
|
|
1694
|
-
const pipelineMissing =
|
|
1694
|
+
const configMissing = parsedConfig ? chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1695
|
+
const pipelineMissing = chunkPL3IQXLK_cjs.collectMissingEnvVars(parsedPipeline);
|
|
1695
1696
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...pipelineMissing])];
|
|
1696
1697
|
if (allMissing.length > 0) {
|
|
1697
1698
|
const projectRoot = await findProjectRoot(pipelinePath);
|
|
@@ -1700,8 +1701,8 @@ var runPipelineCommand = async (file, options) => {
|
|
|
1700
1701
|
process2__default.default.exit(1);
|
|
1701
1702
|
}
|
|
1702
1703
|
}
|
|
1703
|
-
const pipeline = await
|
|
1704
|
-
hasConfigFile ? await
|
|
1704
|
+
const pipeline = await chunkPL3IQXLK_cjs.loadPipelineDefinition(pipelinePath);
|
|
1705
|
+
hasConfigFile ? await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1705
1706
|
const result = await runPipeline(pipeline, pipelinePath, {
|
|
1706
1707
|
headed: options.visible,
|
|
1707
1708
|
browser: options.browser,
|
|
@@ -1756,7 +1757,7 @@ var main = async () => {
|
|
|
1756
1757
|
const browser = resolveBrowserName(options.browser || "chrome");
|
|
1757
1758
|
if (options.preview) {
|
|
1758
1759
|
const hasConfigFile = await fileExists(CONFIG_FILENAME);
|
|
1759
|
-
const config = hasConfigFile ? await
|
|
1760
|
+
const config = hasConfigFile ? await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1760
1761
|
const { cleanup } = await buildAndPreview(config, process2__default.default.cwd());
|
|
1761
1762
|
previewCleanup = cleanup;
|
|
1762
1763
|
}
|
|
@@ -1829,21 +1830,21 @@ var main = async () => {
|
|
|
1829
1830
|
}
|
|
1830
1831
|
return;
|
|
1831
1832
|
}
|
|
1832
|
-
if (
|
|
1833
|
+
if (chunkPL3IQXLK_cjs.isPipelineFile(file)) {
|
|
1833
1834
|
await runPipelineCommand(file, runOpts);
|
|
1834
1835
|
return;
|
|
1835
1836
|
}
|
|
1836
|
-
if (
|
|
1837
|
+
if (chunkPL3IQXLK_cjs.isWorkflowFile(file)) {
|
|
1837
1838
|
await runWorkflowCommand(file, runOpts);
|
|
1838
1839
|
return;
|
|
1839
1840
|
}
|
|
1840
1841
|
const fileContent = await fs3__default.default.readFile(path4__namespace.default.resolve(file), "utf8");
|
|
1841
|
-
if (
|
|
1842
|
+
if (chunkPL3IQXLK_cjs.isPipelineContent(fileContent)) {
|
|
1842
1843
|
console.log(`Note: Detected as pipeline by content structure`);
|
|
1843
1844
|
await runPipelineCommand(file, runOpts);
|
|
1844
1845
|
return;
|
|
1845
1846
|
}
|
|
1846
|
-
if (
|
|
1847
|
+
if (chunkPL3IQXLK_cjs.isWorkflowContent(fileContent)) {
|
|
1847
1848
|
console.log(`Note: Detected as workflow by content structure`);
|
|
1848
1849
|
await runWorkflowCommand(file, runOpts);
|
|
1849
1850
|
return;
|
|
@@ -1924,7 +1925,7 @@ Found ${failedCleanups.length} failed cleanup(s):
|
|
|
1924
1925
|
if (!hasConfigFile) {
|
|
1925
1926
|
throw new Error(`No ${CONFIG_FILENAME} found. Cannot retry cleanup without provider configuration.`);
|
|
1926
1927
|
}
|
|
1927
|
-
const config = await
|
|
1928
|
+
const config = await chunkPL3IQXLK_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
|
|
1928
1929
|
const failedCleanups = await chunkARJYJVRM_cjs.loadFailedCleanups(process2__default.default.cwd());
|
|
1929
1930
|
if (failedCleanups.length === 0) {
|
|
1930
1931
|
console.log("No failed cleanups to retry.");
|