intellitester 0.2.18 → 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.
@@ -7,6 +7,7 @@ import path from 'path';
7
7
  import { spawn } from 'child_process';
8
8
  import { chromium, webkit, firefox } from 'playwright';
9
9
  import prompts from 'prompts';
10
+ import { NumberDictionary, uniqueNamesGenerator, adjectives, animals } from 'unique-names-generator';
10
11
  import { Client, Users, TablesDB, Storage, Teams } from 'node-appwrite';
11
12
  import { Anthropic } from '@llamaindex/anthropic';
12
13
  import { OpenAI } from '@llamaindex/openai';
@@ -476,6 +477,19 @@ var isPipelineContent = (content) => {
476
477
  return false;
477
478
  }
478
479
  };
480
+ function generateRandomUsername() {
481
+ const numberDictionary = NumberDictionary.generate({ min: 0, max: 99 });
482
+ const username = uniqueNamesGenerator({
483
+ dictionaries: [adjectives, animals, numberDictionary],
484
+ separator: "",
485
+ style: "capital",
486
+ length: 3
487
+ });
488
+ if (username.length > 30) {
489
+ return username.slice(0, 30);
490
+ }
491
+ return username;
492
+ }
479
493
 
480
494
  // src/integrations/email/inbucketClient.ts
481
495
  var InbucketClient = class {
@@ -1016,6 +1030,9 @@ function interpolateVariables(value, variables) {
1016
1030
  if (varName === "uuid") {
1017
1031
  return crypto2.randomUUID().split("-")[0];
1018
1032
  }
1033
+ if (varName === "randomUsername") {
1034
+ return generateRandomUsername();
1035
+ }
1019
1036
  return variables.get(varName) ?? match;
1020
1037
  });
1021
1038
  }
@@ -1873,6 +1890,9 @@ function interpolateWorkflowVariables(value, currentVariables, testResults) {
1873
1890
  if (path3 === "uuid") {
1874
1891
  return crypto2.randomUUID().split("-")[0];
1875
1892
  }
1893
+ if (path3 === "randomUsername") {
1894
+ return generateRandomUsername();
1895
+ }
1876
1896
  return currentVariables.get(path3) ?? match;
1877
1897
  });
1878
1898
  }
@@ -1894,6 +1914,9 @@ async function runTestInWorkflow(test, page, context, options, _workflowDir, wor
1894
1914
  if (varName === "uuid") {
1895
1915
  return crypto2.randomUUID().split("-")[0];
1896
1916
  }
1917
+ if (varName === "randomUsername") {
1918
+ return generateRandomUsername();
1919
+ }
1897
1920
  return context.variables.get(varName) ?? match;
1898
1921
  });
1899
1922
  };
@@ -2335,6 +2358,7 @@ Starting workflow: ${workflow.name}`);
2335
2358
  if (!executionContext.variables.has(key)) {
2336
2359
  const interpolated = value.replace(/\{\{(\w+)\}\}/g, (match, varName) => {
2337
2360
  if (varName === "uuid") return crypto2.randomUUID().split("-")[0];
2361
+ if (varName === "randomUsername") return generateRandomUsername();
2338
2362
  return executionContext.variables.get(varName) ?? match;
2339
2363
  });
2340
2364
  executionContext.variables.set(key, interpolated);
@@ -2370,6 +2394,9 @@ Starting workflow: ${workflow.name}`);
2370
2394
  if (varName === "uuid") {
2371
2395
  return crypto2.randomUUID().split("-")[0];
2372
2396
  }
2397
+ if (varName === "randomUsername") {
2398
+ return generateRandomUsername();
2399
+ }
2373
2400
  return executionContext.variables.get(varName) ?? match;
2374
2401
  });
2375
2402
  executionContext.variables.set(key, interpolated);
@@ -2569,6 +2596,7 @@ async function runWorkflow(workflow, workflowFilePath, options = {}) {
2569
2596
  for (const [key, value] of Object.entries(workflow.variables)) {
2570
2597
  const interpolated = value.replace(/\{\{(\w+)\}\}/g, (match, varName) => {
2571
2598
  if (varName === "uuid") return crypto2.randomUUID().split("-")[0];
2599
+ if (varName === "randomUsername") return generateRandomUsername();
2572
2600
  return executionContext.variables.get(varName) ?? match;
2573
2601
  });
2574
2602
  executionContext.variables.set(key, interpolated);
@@ -2689,6 +2717,6 @@ Collected ${serverResources.length} server-tracked resources`);
2689
2717
  }
2690
2718
  }
2691
2719
 
2692
- export { ActionSchema, IntellitesterConfigSchema, LocatorSchema, TestConfigSchema, TestDefinitionSchema, cleanupConfigSchema, cleanupDiscoverSchema, collectMissingEnvVars, createAIProvider, createTestContext, isPipelineContent, isPipelineFile, isWorkflowContent, isWorkflowFile, killServer, loadIntellitesterConfig, loadPipelineDefinition, loadTestDefinition, loadWorkflowDefinition, parseIntellitesterConfig, parsePipelineDefinition, parseTestDefinition, parseWorkflowDefinition, previewConfigSchema, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
2693
- //# sourceMappingURL=chunk-EQJQS4RD.js.map
2694
- //# sourceMappingURL=chunk-EQJQS4RD.js.map
2720
+ export { ActionSchema, IntellitesterConfigSchema, LocatorSchema, TestConfigSchema, TestDefinitionSchema, cleanupConfigSchema, cleanupDiscoverSchema, collectMissingEnvVars, createAIProvider, createTestContext, generateRandomUsername, isPipelineContent, isPipelineFile, isWorkflowContent, isWorkflowFile, killServer, loadIntellitesterConfig, loadPipelineDefinition, loadTestDefinition, loadWorkflowDefinition, parseIntellitesterConfig, parsePipelineDefinition, parseTestDefinition, parseWorkflowDefinition, previewConfigSchema, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
2721
+ //# sourceMappingURL=chunk-LKSREGQS.js.map
2722
+ //# sourceMappingURL=chunk-LKSREGQS.js.map