intellitester 0.2.21 → 0.2.24
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-PP666GZQ.cjs → chunk-GFN6LIOF.cjs} +140 -4
- package/dist/chunk-GFN6LIOF.cjs.map +1 -0
- package/dist/{chunk-CKUSY4ZM.js → chunk-HQOYFF54.js} +140 -5
- package/dist/chunk-HQOYFF54.js.map +1 -0
- package/dist/cli/index.cjs +36 -36
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +34 -34
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CKUSY4ZM.js.map +0 -1
- package/dist/chunk-PP666GZQ.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 chunkGFN6LIOF_cjs = require('../chunk-GFN6LIOF.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 chunkGFN6LIOF_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 chunkGFN6LIOF_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
|
+
chunkGFN6LIOF_cjs.killServer(serverProcess);
|
|
186
186
|
if (trackingServer) await trackingServer.stop();
|
|
187
187
|
process.exit(1);
|
|
188
188
|
};
|
|
@@ -190,7 +190,7 @@ ${"=".repeat(60)}`);
|
|
|
190
190
|
process.on("SIGTERM", signalCleanup);
|
|
191
191
|
const browserName = options.browser ?? pipeline.config?.web?.browser ?? "chromium";
|
|
192
192
|
const headless = options.headed === true ? false : pipeline.config?.web?.headless ?? true;
|
|
193
|
-
const browser = await getBrowser(browserName).launch({ headless });
|
|
193
|
+
const browser = await getBrowser(browserName).launch(chunkGFN6LIOF_cjs.getBrowserLaunchOptions({ headless, browser: browserName }));
|
|
194
194
|
const browserContext = await browser.newContext();
|
|
195
195
|
const page = await browserContext.newPage();
|
|
196
196
|
page.setDefaultTimeout(3e4);
|
|
@@ -198,7 +198,7 @@ ${"=".repeat(60)}`);
|
|
|
198
198
|
variables: /* @__PURE__ */ new Map(),
|
|
199
199
|
lastEmail: null,
|
|
200
200
|
emailClient: null,
|
|
201
|
-
appwriteContext:
|
|
201
|
+
appwriteContext: chunkGFN6LIOF_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
|
+
chunkGFN6LIOF_cjs.setupAppwriteTracking(page, executionContext);
|
|
210
210
|
}
|
|
211
211
|
const completedIds = /* @__PURE__ */ new Set();
|
|
212
212
|
const failedIds = /* @__PURE__ */ new Set();
|
|
@@ -273,10 +273,10 @@ ${"=".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 chunkGFN6LIOF_cjs.loadWorkflowDefinition(workflowFilePath);
|
|
277
277
|
if (workflowRef.variables) {
|
|
278
278
|
for (const [key, value] of Object.entries(workflowRef.variables)) {
|
|
279
|
-
const interpolated =
|
|
279
|
+
const interpolated = chunkGFN6LIOF_cjs.interpolateVariables(value, executionContext.variables);
|
|
280
280
|
executionContext.variables.set(key, interpolated);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
@@ -289,7 +289,7 @@ ${"=".repeat(40)}`);
|
|
|
289
289
|
sessionId,
|
|
290
290
|
testStartTime
|
|
291
291
|
};
|
|
292
|
-
const result = await
|
|
292
|
+
const result = await chunkGFN6LIOF_cjs.runWorkflowWithContext(
|
|
293
293
|
workflowDefinition,
|
|
294
294
|
workflowFilePath,
|
|
295
295
|
workflowOptions
|
|
@@ -426,7 +426,7 @@ ${"=".repeat(60)}`);
|
|
|
426
426
|
process.off("SIGTERM", signalCleanup);
|
|
427
427
|
await browserContext.close();
|
|
428
428
|
await browser.close();
|
|
429
|
-
|
|
429
|
+
chunkGFN6LIOF_cjs.killServer(serverProcess);
|
|
430
430
|
if (trackingServer) {
|
|
431
431
|
await trackingServer.stop();
|
|
432
432
|
}
|
|
@@ -1091,7 +1091,7 @@ function cleanYamlResponse(response) {
|
|
|
1091
1091
|
return cleaned;
|
|
1092
1092
|
}
|
|
1093
1093
|
async function generateTest(naturalLanguage, options) {
|
|
1094
|
-
const provider =
|
|
1094
|
+
const provider = chunkGFN6LIOF_cjs.createAIProvider(options.aiConfig);
|
|
1095
1095
|
let systemPrompt = SYSTEM_PROMPT;
|
|
1096
1096
|
if (options.source !== null) {
|
|
1097
1097
|
const sourceConfig = options.source ?? {};
|
|
@@ -1123,7 +1123,7 @@ Please fix the issue and generate valid YAML.`;
|
|
|
1123
1123
|
const yaml$1 = cleanYamlResponse(response);
|
|
1124
1124
|
lastYaml = yaml$1;
|
|
1125
1125
|
const parsed = yaml.parse(yaml$1);
|
|
1126
|
-
const validated =
|
|
1126
|
+
const validated = chunkGFN6LIOF_cjs.TestDefinitionSchema.parse(parsed);
|
|
1127
1127
|
return {
|
|
1128
1128
|
success: true,
|
|
1129
1129
|
test: validated,
|
|
@@ -1501,7 +1501,7 @@ var validateCommand = async (target) => {
|
|
|
1501
1501
|
throw new Error(`No YAML files found at ${absoluteTarget}`);
|
|
1502
1502
|
}
|
|
1503
1503
|
for (const file of files) {
|
|
1504
|
-
await
|
|
1504
|
+
await chunkGFN6LIOF_cjs.loadTestDefinition(file);
|
|
1505
1505
|
console.log(`\u2713 ${path4__namespace.default.relative(process2__default.default.cwd(), file)} valid`);
|
|
1506
1506
|
}
|
|
1507
1507
|
};
|
|
@@ -1518,8 +1518,8 @@ var runTestCommand = async (target, options) => {
|
|
|
1518
1518
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1519
1519
|
parsedConfig = parse2(configContent);
|
|
1520
1520
|
}
|
|
1521
|
-
const configMissing = parsedConfig ?
|
|
1522
|
-
const testMissing =
|
|
1521
|
+
const configMissing = parsedConfig ? chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1522
|
+
const testMissing = chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedTest);
|
|
1523
1523
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...testMissing])];
|
|
1524
1524
|
if (allMissing.length > 0) {
|
|
1525
1525
|
const projectRoot = await findProjectRoot(absoluteTarget);
|
|
@@ -1528,8 +1528,8 @@ var runTestCommand = async (target, options) => {
|
|
|
1528
1528
|
process2__default.default.exit(1);
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
|
-
const test = await
|
|
1532
|
-
const config = hasConfigFile ? await
|
|
1531
|
+
const test = await chunkGFN6LIOF_cjs.loadTestDefinition(absoluteTarget);
|
|
1532
|
+
const config = hasConfigFile ? await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1533
1533
|
const baseUrl = resolveBaseUrl(test, config?.platforms?.web?.baseUrl);
|
|
1534
1534
|
const headed = options.headed ?? false;
|
|
1535
1535
|
const browser = options.browser ?? "chromium";
|
|
@@ -1543,7 +1543,7 @@ var runTestCommand = async (target, options) => {
|
|
|
1543
1543
|
console.log(
|
|
1544
1544
|
`Running ${path4__namespace.default.basename(absoluteTarget)} on web (${browser}${modeFlags.length > 0 ? ", " + modeFlags.join(", ") : ""})`
|
|
1545
1545
|
);
|
|
1546
|
-
const result = await
|
|
1546
|
+
const result = await chunkGFN6LIOF_cjs.runWebTest(test, {
|
|
1547
1547
|
baseUrl,
|
|
1548
1548
|
headed,
|
|
1549
1549
|
browser,
|
|
@@ -1575,7 +1575,7 @@ var generateCommand = async (prompt, options) => {
|
|
|
1575
1575
|
const { parse: parse2 } = await import('yaml');
|
|
1576
1576
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1577
1577
|
const parsedConfig = parse2(configContent);
|
|
1578
|
-
const configMissing =
|
|
1578
|
+
const configMissing = chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedConfig);
|
|
1579
1579
|
if (configMissing.length > 0) {
|
|
1580
1580
|
const projectRoot = await findProjectRoot(CONFIG_FILENAME);
|
|
1581
1581
|
const canContinue = await validateEnvVars(configMissing, projectRoot || process2__default.default.cwd());
|
|
@@ -1583,7 +1583,7 @@ var generateCommand = async (prompt, options) => {
|
|
|
1583
1583
|
process2__default.default.exit(1);
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
|
-
const config = await
|
|
1586
|
+
const config = await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
|
|
1587
1587
|
if (!config.ai) {
|
|
1588
1588
|
throw new Error('AI configuration missing in intellitester.config.yaml. Add "ai:" section with provider, model, and apiKey.');
|
|
1589
1589
|
}
|
|
@@ -1628,8 +1628,8 @@ var runWorkflowCommand = async (file, options) => {
|
|
|
1628
1628
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1629
1629
|
parsedConfig = parse2(configContent);
|
|
1630
1630
|
}
|
|
1631
|
-
const configMissing = parsedConfig ?
|
|
1632
|
-
const workflowMissing =
|
|
1631
|
+
const configMissing = parsedConfig ? chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1632
|
+
const workflowMissing = chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedWorkflow);
|
|
1633
1633
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...workflowMissing])];
|
|
1634
1634
|
if (allMissing.length > 0) {
|
|
1635
1635
|
const projectRoot = await findProjectRoot(workflowPath);
|
|
@@ -1638,9 +1638,9 @@ var runWorkflowCommand = async (file, options) => {
|
|
|
1638
1638
|
process2__default.default.exit(1);
|
|
1639
1639
|
}
|
|
1640
1640
|
}
|
|
1641
|
-
const workflow = await
|
|
1642
|
-
const config = hasConfigFile ? await
|
|
1643
|
-
const result = await
|
|
1641
|
+
const workflow = await chunkGFN6LIOF_cjs.loadWorkflowDefinition(workflowPath);
|
|
1642
|
+
const config = hasConfigFile ? await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1643
|
+
const result = await chunkGFN6LIOF_cjs.runWorkflow(workflow, workflowPath, {
|
|
1644
1644
|
headed: options.visible,
|
|
1645
1645
|
browser: options.browser,
|
|
1646
1646
|
interactive: options.interactive,
|
|
@@ -1686,8 +1686,8 @@ var runPipelineCommand = async (file, options) => {
|
|
|
1686
1686
|
const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
|
|
1687
1687
|
parsedConfig = parse2(configContent);
|
|
1688
1688
|
}
|
|
1689
|
-
const configMissing = parsedConfig ?
|
|
1690
|
-
const pipelineMissing =
|
|
1689
|
+
const configMissing = parsedConfig ? chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedConfig) : [];
|
|
1690
|
+
const pipelineMissing = chunkGFN6LIOF_cjs.collectMissingEnvVars(parsedPipeline);
|
|
1691
1691
|
const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...pipelineMissing])];
|
|
1692
1692
|
if (allMissing.length > 0) {
|
|
1693
1693
|
const projectRoot = await findProjectRoot(pipelinePath);
|
|
@@ -1696,8 +1696,8 @@ var runPipelineCommand = async (file, options) => {
|
|
|
1696
1696
|
process2__default.default.exit(1);
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
|
-
const pipeline = await
|
|
1700
|
-
hasConfigFile ? await
|
|
1699
|
+
const pipeline = await chunkGFN6LIOF_cjs.loadPipelineDefinition(pipelinePath);
|
|
1700
|
+
hasConfigFile ? await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1701
1701
|
const result = await runPipeline(pipeline, pipelinePath, {
|
|
1702
1702
|
headed: options.visible,
|
|
1703
1703
|
browser: options.browser,
|
|
@@ -1752,7 +1752,7 @@ var main = async () => {
|
|
|
1752
1752
|
const browser = resolveBrowserName(options.browser || "chrome");
|
|
1753
1753
|
if (options.preview) {
|
|
1754
1754
|
const hasConfigFile = await fileExists(CONFIG_FILENAME);
|
|
1755
|
-
const config = hasConfigFile ? await
|
|
1755
|
+
const config = hasConfigFile ? await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
|
|
1756
1756
|
const { cleanup } = await buildAndPreview(config, process2__default.default.cwd());
|
|
1757
1757
|
previewCleanup = cleanup;
|
|
1758
1758
|
}
|
|
@@ -1825,21 +1825,21 @@ var main = async () => {
|
|
|
1825
1825
|
}
|
|
1826
1826
|
return;
|
|
1827
1827
|
}
|
|
1828
|
-
if (
|
|
1828
|
+
if (chunkGFN6LIOF_cjs.isPipelineFile(file)) {
|
|
1829
1829
|
await runPipelineCommand(file, runOpts);
|
|
1830
1830
|
return;
|
|
1831
1831
|
}
|
|
1832
|
-
if (
|
|
1832
|
+
if (chunkGFN6LIOF_cjs.isWorkflowFile(file)) {
|
|
1833
1833
|
await runWorkflowCommand(file, runOpts);
|
|
1834
1834
|
return;
|
|
1835
1835
|
}
|
|
1836
1836
|
const fileContent = await fs3__default.default.readFile(path4__namespace.default.resolve(file), "utf8");
|
|
1837
|
-
if (
|
|
1837
|
+
if (chunkGFN6LIOF_cjs.isPipelineContent(fileContent)) {
|
|
1838
1838
|
console.log(`Note: Detected as pipeline by content structure`);
|
|
1839
1839
|
await runPipelineCommand(file, runOpts);
|
|
1840
1840
|
return;
|
|
1841
1841
|
}
|
|
1842
|
-
if (
|
|
1842
|
+
if (chunkGFN6LIOF_cjs.isWorkflowContent(fileContent)) {
|
|
1843
1843
|
console.log(`Note: Detected as workflow by content structure`);
|
|
1844
1844
|
await runWorkflowCommand(file, runOpts);
|
|
1845
1845
|
return;
|
|
@@ -1920,7 +1920,7 @@ Found ${failedCleanups.length} failed cleanup(s):
|
|
|
1920
1920
|
if (!hasConfigFile) {
|
|
1921
1921
|
throw new Error(`No ${CONFIG_FILENAME} found. Cannot retry cleanup without provider configuration.`);
|
|
1922
1922
|
}
|
|
1923
|
-
const config = await
|
|
1923
|
+
const config = await chunkGFN6LIOF_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
|
|
1924
1924
|
const failedCleanups = await chunkARJYJVRM_cjs.loadFailedCleanups(process2__default.default.cwd());
|
|
1925
1925
|
if (failedCleanups.length === 0) {
|
|
1926
1926
|
console.log("No failed cleanups to retry.");
|