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
|
@@ -1011,6 +1011,48 @@ var APPWRITE_DELETE_PATTERNS = {
|
|
|
1011
1011
|
teamDelete: /\/v1\/teams\/([\w-]+)$/,
|
|
1012
1012
|
membershipDelete: /\/v1\/teams\/([\w-]+)\/memberships\/([\w-]+)$/
|
|
1013
1013
|
};
|
|
1014
|
+
|
|
1015
|
+
// src/executors/web/browserOptions.ts
|
|
1016
|
+
function getBrowserLaunchOptions(options) {
|
|
1017
|
+
const { headless, browser } = options;
|
|
1018
|
+
if (browser === "chromium" || !browser) {
|
|
1019
|
+
return {
|
|
1020
|
+
headless,
|
|
1021
|
+
args: [
|
|
1022
|
+
// Shared memory - critical for Docker/CI, harmless locally
|
|
1023
|
+
"--disable-dev-shm-usage",
|
|
1024
|
+
// GPU acceleration - not needed in headless mode
|
|
1025
|
+
"--disable-gpu",
|
|
1026
|
+
// Reduce overhead
|
|
1027
|
+
"--disable-extensions",
|
|
1028
|
+
// Prevent JavaScript throttling (helps with slow page loads)
|
|
1029
|
+
"--disable-background-timer-throttling",
|
|
1030
|
+
"--disable-backgrounding-occluded-windows",
|
|
1031
|
+
"--disable-renderer-backgrounding",
|
|
1032
|
+
// Process isolation - reduces overhead for testing
|
|
1033
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
1034
|
+
// Networking tweaks
|
|
1035
|
+
"--disable-features=VizDisplayCompositor",
|
|
1036
|
+
"--disable-blink-features=AutomationControlled"
|
|
1037
|
+
]
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
if (browser === "firefox") {
|
|
1041
|
+
return {
|
|
1042
|
+
headless,
|
|
1043
|
+
firefoxUserPrefs: {
|
|
1044
|
+
// Enable JIT (disabled in automation mode by default, causes 2-4x JS slowdown)
|
|
1045
|
+
"javascript.options.jit": true,
|
|
1046
|
+
// Disable fission for stability/speed
|
|
1047
|
+
"fission.autostart": false,
|
|
1048
|
+
// Disable hardware acceleration overhead in headless
|
|
1049
|
+
"layers.acceleration.disabled": true,
|
|
1050
|
+
"gfx.webrender.all": false
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
return { headless };
|
|
1055
|
+
}
|
|
1014
1056
|
function resolveEnvVars(value) {
|
|
1015
1057
|
return value.replace(/\$\{(\w+)\}/g, (_, name) => process.env[name] || "");
|
|
1016
1058
|
}
|
|
@@ -1963,7 +2005,7 @@ var runWebTest = async (test, options = {}) => {
|
|
|
1963
2005
|
process.on("SIGINT", cleanup);
|
|
1964
2006
|
process.on("SIGTERM", cleanup);
|
|
1965
2007
|
console.log(`Launching ${browserName}${headless ? " (headless)" : " (visible)"}...`);
|
|
1966
|
-
const browser = await getBrowser(browserName).launch({ headless });
|
|
2008
|
+
const browser = await getBrowser(browserName).launch(getBrowserLaunchOptions({ headless, browser: browserName }));
|
|
1967
2009
|
console.log(`Browser launched successfully`);
|
|
1968
2010
|
const browserContext = await browser.newContext();
|
|
1969
2011
|
const page = await browserContext.newPage();
|
|
@@ -2498,6 +2540,99 @@ async function runTestInWorkflow(test, page, context, options, _workflowDir, wor
|
|
|
2498
2540
|
await page.pause();
|
|
2499
2541
|
break;
|
|
2500
2542
|
}
|
|
2543
|
+
case "waitForSelector": {
|
|
2544
|
+
const handle = resolveLocator2(action.target);
|
|
2545
|
+
const timeout = action.timeout ?? 3e4;
|
|
2546
|
+
if (debugMode) {
|
|
2547
|
+
console.log(` [DEBUG] Waiting for element to be ${action.state}:`, action.target);
|
|
2548
|
+
}
|
|
2549
|
+
const waitForCondition2 = async (checkFn, timeoutMs, errorMessage) => {
|
|
2550
|
+
const start = Date.now();
|
|
2551
|
+
while (Date.now() - start < timeoutMs) {
|
|
2552
|
+
if (await checkFn()) return;
|
|
2553
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
2554
|
+
}
|
|
2555
|
+
throw new Error(errorMessage);
|
|
2556
|
+
};
|
|
2557
|
+
switch (action.state) {
|
|
2558
|
+
case "visible":
|
|
2559
|
+
case "hidden":
|
|
2560
|
+
case "attached":
|
|
2561
|
+
case "detached":
|
|
2562
|
+
await handle.waitFor({ state: action.state, timeout });
|
|
2563
|
+
break;
|
|
2564
|
+
case "enabled":
|
|
2565
|
+
await waitForCondition2(
|
|
2566
|
+
() => handle.isEnabled(),
|
|
2567
|
+
timeout,
|
|
2568
|
+
`Element did not become enabled within ${timeout}ms`
|
|
2569
|
+
);
|
|
2570
|
+
break;
|
|
2571
|
+
case "disabled":
|
|
2572
|
+
await waitForCondition2(
|
|
2573
|
+
() => handle.isDisabled(),
|
|
2574
|
+
timeout,
|
|
2575
|
+
`Element did not become disabled within ${timeout}ms`
|
|
2576
|
+
);
|
|
2577
|
+
break;
|
|
2578
|
+
}
|
|
2579
|
+
break;
|
|
2580
|
+
}
|
|
2581
|
+
case "conditional": {
|
|
2582
|
+
const handle = resolveLocator2(action.condition.target);
|
|
2583
|
+
let conditionMet = false;
|
|
2584
|
+
if (debugMode) {
|
|
2585
|
+
console.log(` [DEBUG] Checking condition ${action.condition.type}:`, action.condition.target);
|
|
2586
|
+
}
|
|
2587
|
+
try {
|
|
2588
|
+
switch (action.condition.type) {
|
|
2589
|
+
case "exists":
|
|
2590
|
+
await handle.waitFor({ state: "attached", timeout: 500 });
|
|
2591
|
+
conditionMet = true;
|
|
2592
|
+
break;
|
|
2593
|
+
case "notExists":
|
|
2594
|
+
try {
|
|
2595
|
+
await handle.waitFor({ state: "detached", timeout: 500 });
|
|
2596
|
+
conditionMet = true;
|
|
2597
|
+
} catch {
|
|
2598
|
+
conditionMet = false;
|
|
2599
|
+
}
|
|
2600
|
+
break;
|
|
2601
|
+
case "visible":
|
|
2602
|
+
conditionMet = await handle.isVisible();
|
|
2603
|
+
break;
|
|
2604
|
+
case "hidden":
|
|
2605
|
+
conditionMet = !await handle.isVisible();
|
|
2606
|
+
break;
|
|
2607
|
+
}
|
|
2608
|
+
} catch {
|
|
2609
|
+
conditionMet = action.condition.type === "notExists";
|
|
2610
|
+
}
|
|
2611
|
+
if (debugMode) {
|
|
2612
|
+
console.log(` [DEBUG] Condition result: ${conditionMet}`);
|
|
2613
|
+
}
|
|
2614
|
+
const stepsToRun = conditionMet ? action.then : action.else ?? [];
|
|
2615
|
+
for (const nestedAction of stepsToRun) {
|
|
2616
|
+
switch (nestedAction.type) {
|
|
2617
|
+
case "screenshot": {
|
|
2618
|
+
const filename = nestedAction.name ?? `conditional-step.png`;
|
|
2619
|
+
const filePath = path.join(screenshotDir, filename);
|
|
2620
|
+
await page.screenshot({ path: filePath, fullPage: true });
|
|
2621
|
+
results.push({ action: nestedAction, status: "passed", screenshotPath: filePath });
|
|
2622
|
+
break;
|
|
2623
|
+
}
|
|
2624
|
+
case "fail": {
|
|
2625
|
+
throw new Error(nestedAction.message);
|
|
2626
|
+
}
|
|
2627
|
+
default:
|
|
2628
|
+
throw new Error(`Nested action type ${nestedAction.type} in conditional not yet supported`);
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
break;
|
|
2632
|
+
}
|
|
2633
|
+
case "fail": {
|
|
2634
|
+
throw new Error(action.message);
|
|
2635
|
+
}
|
|
2501
2636
|
default:
|
|
2502
2637
|
throw new Error(`Unsupported action type: ${action.type}`);
|
|
2503
2638
|
}
|
|
@@ -2922,7 +3057,7 @@ async function runWorkflow(workflow, workflowFilePath, options = {}) {
|
|
|
2922
3057
|
const browserName = options.browser ?? workflow.config?.web?.browser ?? "chromium";
|
|
2923
3058
|
const headless = options.headed === true ? false : workflow.config?.web?.headless ?? true;
|
|
2924
3059
|
console.log(`Launching ${browserName}${headless ? " (headless)" : " (visible)"}...`);
|
|
2925
|
-
const browser = await getBrowser2(browserName).launch({ headless });
|
|
3060
|
+
const browser = await getBrowser2(browserName).launch(getBrowserLaunchOptions({ headless, browser: browserName }));
|
|
2926
3061
|
console.log(`Browser launched successfully`);
|
|
2927
3062
|
const browserContext = await browser.newContext();
|
|
2928
3063
|
const page = await browserContext.newPage();
|
|
@@ -3059,6 +3194,6 @@ Collected ${serverResources.length} server-tracked resources`);
|
|
|
3059
3194
|
}
|
|
3060
3195
|
}
|
|
3061
3196
|
|
|
3062
|
-
export { ActionSchema, IntellitesterConfigSchema, LocatorSchema, TestConfigSchema, TestDefinitionSchema, cleanupConfigSchema, cleanupDiscoverSchema, collectMissingEnvVars, createAIProvider, createTestContext, generateFillerText, generateRandomEmail, generateRandomPhone, generateRandomPhoto, generateRandomUsername, interpolateVariables, isPipelineContent, isPipelineFile, isWorkflowContent, isWorkflowFile, killServer, loadIntellitesterConfig, loadPipelineDefinition, loadTestDefinition, loadWorkflowDefinition, parseIntellitesterConfig, parsePipelineDefinition, parseTestDefinition, parseWorkflowDefinition, previewConfigSchema, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
|
|
3063
|
-
//# sourceMappingURL=chunk-
|
|
3064
|
-
//# sourceMappingURL=chunk-
|
|
3197
|
+
export { ActionSchema, IntellitesterConfigSchema, LocatorSchema, TestConfigSchema, TestDefinitionSchema, cleanupConfigSchema, cleanupDiscoverSchema, collectMissingEnvVars, createAIProvider, createTestContext, generateFillerText, generateRandomEmail, generateRandomPhone, generateRandomPhoto, generateRandomUsername, getBrowserLaunchOptions, interpolateVariables, isPipelineContent, isPipelineFile, isWorkflowContent, isWorkflowFile, killServer, loadIntellitesterConfig, loadPipelineDefinition, loadTestDefinition, loadWorkflowDefinition, parseIntellitesterConfig, parsePipelineDefinition, parseTestDefinition, parseWorkflowDefinition, previewConfigSchema, runWebTest, runWorkflow, runWorkflowWithContext, setupAppwriteTracking, startTrackingServer, startWebServer };
|
|
3198
|
+
//# sourceMappingURL=chunk-HQOYFF54.js.map
|
|
3199
|
+
//# sourceMappingURL=chunk-HQOYFF54.js.map
|