intellitester 0.2.19 → 0.2.21

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkLFCMPHWU_cjs = require('../chunk-LFCMPHWU.cjs');
4
+ var chunkPP666GZQ_cjs = require('../chunk-PP666GZQ.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 chunkLFCMPHWU_cjs.startTrackingServer({ port: 0 });
161
+ trackingServer = await chunkPP666GZQ_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 chunkLFCMPHWU_cjs.startWebServer({
173
+ serverProcess = await chunkPP666GZQ_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
- chunkLFCMPHWU_cjs.killServer(serverProcess);
185
+ chunkPP666GZQ_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: chunkLFCMPHWU_cjs.createTestContext(),
201
+ appwriteContext: chunkPP666GZQ_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
- chunkLFCMPHWU_cjs.setupAppwriteTracking(page, executionContext);
209
+ chunkPP666GZQ_cjs.setupAppwriteTracking(page, executionContext);
210
210
  }
211
211
  const completedIds = /* @__PURE__ */ new Set();
212
212
  const failedIds = /* @__PURE__ */ new Set();
@@ -273,18 +273,10 @@ ${"=".repeat(40)}`);
273
273
  console.log(`File: ${workflowRef.file}`);
274
274
  console.log(`${"=".repeat(40)}`);
275
275
  try {
276
- const workflowDefinition = await chunkLFCMPHWU_cjs.loadWorkflowDefinition(workflowFilePath);
276
+ const workflowDefinition = await chunkPP666GZQ_cjs.loadWorkflowDefinition(workflowFilePath);
277
277
  if (workflowRef.variables) {
278
278
  for (const [key, value] of Object.entries(workflowRef.variables)) {
279
- const interpolated = value.replace(/\{\{(\w+)\}\}/g, (match, varName) => {
280
- if (varName === "uuid") {
281
- return crypto__default.default.randomUUID().split("-")[0];
282
- }
283
- if (varName === "randomUsername") {
284
- return chunkLFCMPHWU_cjs.generateRandomUsername();
285
- }
286
- return executionContext.variables.get(varName) ?? match;
287
- });
279
+ const interpolated = chunkPP666GZQ_cjs.interpolateVariables(value, executionContext.variables);
288
280
  executionContext.variables.set(key, interpolated);
289
281
  }
290
282
  }
@@ -297,7 +289,7 @@ ${"=".repeat(40)}`);
297
289
  sessionId,
298
290
  testStartTime
299
291
  };
300
- const result = await chunkLFCMPHWU_cjs.runWorkflowWithContext(
292
+ const result = await chunkPP666GZQ_cjs.runWorkflowWithContext(
301
293
  workflowDefinition,
302
294
  workflowFilePath,
303
295
  workflowOptions
@@ -434,7 +426,7 @@ ${"=".repeat(60)}`);
434
426
  process.off("SIGTERM", signalCleanup);
435
427
  await browserContext.close();
436
428
  await browser.close();
437
- chunkLFCMPHWU_cjs.killServer(serverProcess);
429
+ chunkPP666GZQ_cjs.killServer(serverProcess);
438
430
  if (trackingServer) {
439
431
  await trackingServer.stop();
440
432
  }
@@ -1099,7 +1091,7 @@ function cleanYamlResponse(response) {
1099
1091
  return cleaned;
1100
1092
  }
1101
1093
  async function generateTest(naturalLanguage, options) {
1102
- const provider = chunkLFCMPHWU_cjs.createAIProvider(options.aiConfig);
1094
+ const provider = chunkPP666GZQ_cjs.createAIProvider(options.aiConfig);
1103
1095
  let systemPrompt = SYSTEM_PROMPT;
1104
1096
  if (options.source !== null) {
1105
1097
  const sourceConfig = options.source ?? {};
@@ -1131,7 +1123,7 @@ Please fix the issue and generate valid YAML.`;
1131
1123
  const yaml$1 = cleanYamlResponse(response);
1132
1124
  lastYaml = yaml$1;
1133
1125
  const parsed = yaml.parse(yaml$1);
1134
- const validated = chunkLFCMPHWU_cjs.TestDefinitionSchema.parse(parsed);
1126
+ const validated = chunkPP666GZQ_cjs.TestDefinitionSchema.parse(parsed);
1135
1127
  return {
1136
1128
  success: true,
1137
1129
  test: validated,
@@ -1509,7 +1501,7 @@ var validateCommand = async (target) => {
1509
1501
  throw new Error(`No YAML files found at ${absoluteTarget}`);
1510
1502
  }
1511
1503
  for (const file of files) {
1512
- await chunkLFCMPHWU_cjs.loadTestDefinition(file);
1504
+ await chunkPP666GZQ_cjs.loadTestDefinition(file);
1513
1505
  console.log(`\u2713 ${path4__namespace.default.relative(process2__default.default.cwd(), file)} valid`);
1514
1506
  }
1515
1507
  };
@@ -1526,8 +1518,8 @@ var runTestCommand = async (target, options) => {
1526
1518
  const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
1527
1519
  parsedConfig = parse2(configContent);
1528
1520
  }
1529
- const configMissing = parsedConfig ? chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedConfig) : [];
1530
- const testMissing = chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedTest);
1521
+ const configMissing = parsedConfig ? chunkPP666GZQ_cjs.collectMissingEnvVars(parsedConfig) : [];
1522
+ const testMissing = chunkPP666GZQ_cjs.collectMissingEnvVars(parsedTest);
1531
1523
  const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...testMissing])];
1532
1524
  if (allMissing.length > 0) {
1533
1525
  const projectRoot = await findProjectRoot(absoluteTarget);
@@ -1536,8 +1528,8 @@ var runTestCommand = async (target, options) => {
1536
1528
  process2__default.default.exit(1);
1537
1529
  }
1538
1530
  }
1539
- const test = await chunkLFCMPHWU_cjs.loadTestDefinition(absoluteTarget);
1540
- const config = hasConfigFile ? await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1531
+ const test = await chunkPP666GZQ_cjs.loadTestDefinition(absoluteTarget);
1532
+ const config = hasConfigFile ? await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1541
1533
  const baseUrl = resolveBaseUrl(test, config?.platforms?.web?.baseUrl);
1542
1534
  const headed = options.headed ?? false;
1543
1535
  const browser = options.browser ?? "chromium";
@@ -1551,7 +1543,7 @@ var runTestCommand = async (target, options) => {
1551
1543
  console.log(
1552
1544
  `Running ${path4__namespace.default.basename(absoluteTarget)} on web (${browser}${modeFlags.length > 0 ? ", " + modeFlags.join(", ") : ""})`
1553
1545
  );
1554
- const result = await chunkLFCMPHWU_cjs.runWebTest(test, {
1546
+ const result = await chunkPP666GZQ_cjs.runWebTest(test, {
1555
1547
  baseUrl,
1556
1548
  headed,
1557
1549
  browser,
@@ -1583,7 +1575,7 @@ var generateCommand = async (prompt, options) => {
1583
1575
  const { parse: parse2 } = await import('yaml');
1584
1576
  const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
1585
1577
  const parsedConfig = parse2(configContent);
1586
- const configMissing = chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedConfig);
1578
+ const configMissing = chunkPP666GZQ_cjs.collectMissingEnvVars(parsedConfig);
1587
1579
  if (configMissing.length > 0) {
1588
1580
  const projectRoot = await findProjectRoot(CONFIG_FILENAME);
1589
1581
  const canContinue = await validateEnvVars(configMissing, projectRoot || process2__default.default.cwd());
@@ -1591,7 +1583,7 @@ var generateCommand = async (prompt, options) => {
1591
1583
  process2__default.default.exit(1);
1592
1584
  }
1593
1585
  }
1594
- const config = await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
1586
+ const config = await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
1595
1587
  if (!config.ai) {
1596
1588
  throw new Error('AI configuration missing in intellitester.config.yaml. Add "ai:" section with provider, model, and apiKey.');
1597
1589
  }
@@ -1636,8 +1628,8 @@ var runWorkflowCommand = async (file, options) => {
1636
1628
  const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
1637
1629
  parsedConfig = parse2(configContent);
1638
1630
  }
1639
- const configMissing = parsedConfig ? chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedConfig) : [];
1640
- const workflowMissing = chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedWorkflow);
1631
+ const configMissing = parsedConfig ? chunkPP666GZQ_cjs.collectMissingEnvVars(parsedConfig) : [];
1632
+ const workflowMissing = chunkPP666GZQ_cjs.collectMissingEnvVars(parsedWorkflow);
1641
1633
  const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...workflowMissing])];
1642
1634
  if (allMissing.length > 0) {
1643
1635
  const projectRoot = await findProjectRoot(workflowPath);
@@ -1646,9 +1638,9 @@ var runWorkflowCommand = async (file, options) => {
1646
1638
  process2__default.default.exit(1);
1647
1639
  }
1648
1640
  }
1649
- const workflow = await chunkLFCMPHWU_cjs.loadWorkflowDefinition(workflowPath);
1650
- const config = hasConfigFile ? await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1651
- const result = await chunkLFCMPHWU_cjs.runWorkflow(workflow, workflowPath, {
1641
+ const workflow = await chunkPP666GZQ_cjs.loadWorkflowDefinition(workflowPath);
1642
+ const config = hasConfigFile ? await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1643
+ const result = await chunkPP666GZQ_cjs.runWorkflow(workflow, workflowPath, {
1652
1644
  headed: options.visible,
1653
1645
  browser: options.browser,
1654
1646
  interactive: options.interactive,
@@ -1694,8 +1686,8 @@ var runPipelineCommand = async (file, options) => {
1694
1686
  const configContent = await fs3__default.default.readFile(CONFIG_FILENAME, "utf8");
1695
1687
  parsedConfig = parse2(configContent);
1696
1688
  }
1697
- const configMissing = parsedConfig ? chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedConfig) : [];
1698
- const pipelineMissing = chunkLFCMPHWU_cjs.collectMissingEnvVars(parsedPipeline);
1689
+ const configMissing = parsedConfig ? chunkPP666GZQ_cjs.collectMissingEnvVars(parsedConfig) : [];
1690
+ const pipelineMissing = chunkPP666GZQ_cjs.collectMissingEnvVars(parsedPipeline);
1699
1691
  const allMissing = [.../* @__PURE__ */ new Set([...configMissing, ...pipelineMissing])];
1700
1692
  if (allMissing.length > 0) {
1701
1693
  const projectRoot = await findProjectRoot(pipelinePath);
@@ -1704,8 +1696,8 @@ var runPipelineCommand = async (file, options) => {
1704
1696
  process2__default.default.exit(1);
1705
1697
  }
1706
1698
  }
1707
- const pipeline = await chunkLFCMPHWU_cjs.loadPipelineDefinition(pipelinePath);
1708
- hasConfigFile ? await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1699
+ const pipeline = await chunkPP666GZQ_cjs.loadPipelineDefinition(pipelinePath);
1700
+ hasConfigFile ? await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1709
1701
  const result = await runPipeline(pipeline, pipelinePath, {
1710
1702
  headed: options.visible,
1711
1703
  browser: options.browser,
@@ -1760,7 +1752,7 @@ var main = async () => {
1760
1752
  const browser = resolveBrowserName(options.browser || "chrome");
1761
1753
  if (options.preview) {
1762
1754
  const hasConfigFile = await fileExists(CONFIG_FILENAME);
1763
- const config = hasConfigFile ? await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1755
+ const config = hasConfigFile ? await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME) : void 0;
1764
1756
  const { cleanup } = await buildAndPreview(config, process2__default.default.cwd());
1765
1757
  previewCleanup = cleanup;
1766
1758
  }
@@ -1833,21 +1825,21 @@ var main = async () => {
1833
1825
  }
1834
1826
  return;
1835
1827
  }
1836
- if (chunkLFCMPHWU_cjs.isPipelineFile(file)) {
1828
+ if (chunkPP666GZQ_cjs.isPipelineFile(file)) {
1837
1829
  await runPipelineCommand(file, runOpts);
1838
1830
  return;
1839
1831
  }
1840
- if (chunkLFCMPHWU_cjs.isWorkflowFile(file)) {
1832
+ if (chunkPP666GZQ_cjs.isWorkflowFile(file)) {
1841
1833
  await runWorkflowCommand(file, runOpts);
1842
1834
  return;
1843
1835
  }
1844
1836
  const fileContent = await fs3__default.default.readFile(path4__namespace.default.resolve(file), "utf8");
1845
- if (chunkLFCMPHWU_cjs.isPipelineContent(fileContent)) {
1837
+ if (chunkPP666GZQ_cjs.isPipelineContent(fileContent)) {
1846
1838
  console.log(`Note: Detected as pipeline by content structure`);
1847
1839
  await runPipelineCommand(file, runOpts);
1848
1840
  return;
1849
1841
  }
1850
- if (chunkLFCMPHWU_cjs.isWorkflowContent(fileContent)) {
1842
+ if (chunkPP666GZQ_cjs.isWorkflowContent(fileContent)) {
1851
1843
  console.log(`Note: Detected as workflow by content structure`);
1852
1844
  await runWorkflowCommand(file, runOpts);
1853
1845
  return;
@@ -1928,7 +1920,7 @@ Found ${failedCleanups.length} failed cleanup(s):
1928
1920
  if (!hasConfigFile) {
1929
1921
  throw new Error(`No ${CONFIG_FILENAME} found. Cannot retry cleanup without provider configuration.`);
1930
1922
  }
1931
- const config = await chunkLFCMPHWU_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
1923
+ const config = await chunkPP666GZQ_cjs.loadIntellitesterConfig(CONFIG_FILENAME);
1932
1924
  const failedCleanups = await chunkARJYJVRM_cjs.loadFailedCleanups(process2__default.default.cwd());
1933
1925
  if (failedCleanups.length === 0) {
1934
1926
  console.log("No failed cleanups to retry.");