intellitester 0.2.16 → 0.2.19

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