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
|
@@ -1020,6 +1020,48 @@ var APPWRITE_DELETE_PATTERNS = {
|
|
|
1020
1020
|
teamDelete: /\/v1\/teams\/([\w-]+)$/,
|
|
1021
1021
|
membershipDelete: /\/v1\/teams\/([\w-]+)\/memberships\/([\w-]+)$/
|
|
1022
1022
|
};
|
|
1023
|
+
|
|
1024
|
+
// src/executors/web/browserOptions.ts
|
|
1025
|
+
function getBrowserLaunchOptions(options) {
|
|
1026
|
+
const { headless, browser } = options;
|
|
1027
|
+
if (browser === "chromium" || !browser) {
|
|
1028
|
+
return {
|
|
1029
|
+
headless,
|
|
1030
|
+
args: [
|
|
1031
|
+
// Shared memory - critical for Docker/CI, harmless locally
|
|
1032
|
+
"--disable-dev-shm-usage",
|
|
1033
|
+
// GPU acceleration - not needed in headless mode
|
|
1034
|
+
"--disable-gpu",
|
|
1035
|
+
// Reduce overhead
|
|
1036
|
+
"--disable-extensions",
|
|
1037
|
+
// Prevent JavaScript throttling (helps with slow page loads)
|
|
1038
|
+
"--disable-background-timer-throttling",
|
|
1039
|
+
"--disable-backgrounding-occluded-windows",
|
|
1040
|
+
"--disable-renderer-backgrounding",
|
|
1041
|
+
// Process isolation - reduces overhead for testing
|
|
1042
|
+
"--disable-features=IsolateOrigins,site-per-process",
|
|
1043
|
+
// Networking tweaks
|
|
1044
|
+
"--disable-features=VizDisplayCompositor",
|
|
1045
|
+
"--disable-blink-features=AutomationControlled"
|
|
1046
|
+
]
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
if (browser === "firefox") {
|
|
1050
|
+
return {
|
|
1051
|
+
headless,
|
|
1052
|
+
firefoxUserPrefs: {
|
|
1053
|
+
// Enable JIT (disabled in automation mode by default, causes 2-4x JS slowdown)
|
|
1054
|
+
"javascript.options.jit": true,
|
|
1055
|
+
// Disable fission for stability/speed
|
|
1056
|
+
"fission.autostart": false,
|
|
1057
|
+
// Disable hardware acceleration overhead in headless
|
|
1058
|
+
"layers.acceleration.disabled": true,
|
|
1059
|
+
"gfx.webrender.all": false
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
return { headless };
|
|
1064
|
+
}
|
|
1023
1065
|
function resolveEnvVars(value) {
|
|
1024
1066
|
return value.replace(/\$\{(\w+)\}/g, (_, name) => process.env[name] || "");
|
|
1025
1067
|
}
|
|
@@ -1972,7 +2014,7 @@ var runWebTest = async (test, options = {}) => {
|
|
|
1972
2014
|
process.on("SIGINT", cleanup);
|
|
1973
2015
|
process.on("SIGTERM", cleanup);
|
|
1974
2016
|
console.log(`Launching ${browserName}${headless ? " (headless)" : " (visible)"}...`);
|
|
1975
|
-
const browser = await getBrowser(browserName).launch({ headless });
|
|
2017
|
+
const browser = await getBrowser(browserName).launch(getBrowserLaunchOptions({ headless, browser: browserName }));
|
|
1976
2018
|
console.log(`Browser launched successfully`);
|
|
1977
2019
|
const browserContext = await browser.newContext();
|
|
1978
2020
|
const page = await browserContext.newPage();
|
|
@@ -2507,6 +2549,99 @@ async function runTestInWorkflow(test, page, context, options, _workflowDir, wor
|
|
|
2507
2549
|
await page.pause();
|
|
2508
2550
|
break;
|
|
2509
2551
|
}
|
|
2552
|
+
case "waitForSelector": {
|
|
2553
|
+
const handle = resolveLocator2(action.target);
|
|
2554
|
+
const timeout = action.timeout ?? 3e4;
|
|
2555
|
+
if (debugMode) {
|
|
2556
|
+
console.log(` [DEBUG] Waiting for element to be ${action.state}:`, action.target);
|
|
2557
|
+
}
|
|
2558
|
+
const waitForCondition2 = async (checkFn, timeoutMs, errorMessage) => {
|
|
2559
|
+
const start = Date.now();
|
|
2560
|
+
while (Date.now() - start < timeoutMs) {
|
|
2561
|
+
if (await checkFn()) return;
|
|
2562
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
2563
|
+
}
|
|
2564
|
+
throw new Error(errorMessage);
|
|
2565
|
+
};
|
|
2566
|
+
switch (action.state) {
|
|
2567
|
+
case "visible":
|
|
2568
|
+
case "hidden":
|
|
2569
|
+
case "attached":
|
|
2570
|
+
case "detached":
|
|
2571
|
+
await handle.waitFor({ state: action.state, timeout });
|
|
2572
|
+
break;
|
|
2573
|
+
case "enabled":
|
|
2574
|
+
await waitForCondition2(
|
|
2575
|
+
() => handle.isEnabled(),
|
|
2576
|
+
timeout,
|
|
2577
|
+
`Element did not become enabled within ${timeout}ms`
|
|
2578
|
+
);
|
|
2579
|
+
break;
|
|
2580
|
+
case "disabled":
|
|
2581
|
+
await waitForCondition2(
|
|
2582
|
+
() => handle.isDisabled(),
|
|
2583
|
+
timeout,
|
|
2584
|
+
`Element did not become disabled within ${timeout}ms`
|
|
2585
|
+
);
|
|
2586
|
+
break;
|
|
2587
|
+
}
|
|
2588
|
+
break;
|
|
2589
|
+
}
|
|
2590
|
+
case "conditional": {
|
|
2591
|
+
const handle = resolveLocator2(action.condition.target);
|
|
2592
|
+
let conditionMet = false;
|
|
2593
|
+
if (debugMode) {
|
|
2594
|
+
console.log(` [DEBUG] Checking condition ${action.condition.type}:`, action.condition.target);
|
|
2595
|
+
}
|
|
2596
|
+
try {
|
|
2597
|
+
switch (action.condition.type) {
|
|
2598
|
+
case "exists":
|
|
2599
|
+
await handle.waitFor({ state: "attached", timeout: 500 });
|
|
2600
|
+
conditionMet = true;
|
|
2601
|
+
break;
|
|
2602
|
+
case "notExists":
|
|
2603
|
+
try {
|
|
2604
|
+
await handle.waitFor({ state: "detached", timeout: 500 });
|
|
2605
|
+
conditionMet = true;
|
|
2606
|
+
} catch {
|
|
2607
|
+
conditionMet = false;
|
|
2608
|
+
}
|
|
2609
|
+
break;
|
|
2610
|
+
case "visible":
|
|
2611
|
+
conditionMet = await handle.isVisible();
|
|
2612
|
+
break;
|
|
2613
|
+
case "hidden":
|
|
2614
|
+
conditionMet = !await handle.isVisible();
|
|
2615
|
+
break;
|
|
2616
|
+
}
|
|
2617
|
+
} catch {
|
|
2618
|
+
conditionMet = action.condition.type === "notExists";
|
|
2619
|
+
}
|
|
2620
|
+
if (debugMode) {
|
|
2621
|
+
console.log(` [DEBUG] Condition result: ${conditionMet}`);
|
|
2622
|
+
}
|
|
2623
|
+
const stepsToRun = conditionMet ? action.then : action.else ?? [];
|
|
2624
|
+
for (const nestedAction of stepsToRun) {
|
|
2625
|
+
switch (nestedAction.type) {
|
|
2626
|
+
case "screenshot": {
|
|
2627
|
+
const filename = nestedAction.name ?? `conditional-step.png`;
|
|
2628
|
+
const filePath = path__default.default.join(screenshotDir, filename);
|
|
2629
|
+
await page.screenshot({ path: filePath, fullPage: true });
|
|
2630
|
+
results.push({ action: nestedAction, status: "passed", screenshotPath: filePath });
|
|
2631
|
+
break;
|
|
2632
|
+
}
|
|
2633
|
+
case "fail": {
|
|
2634
|
+
throw new Error(nestedAction.message);
|
|
2635
|
+
}
|
|
2636
|
+
default:
|
|
2637
|
+
throw new Error(`Nested action type ${nestedAction.type} in conditional not yet supported`);
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
break;
|
|
2641
|
+
}
|
|
2642
|
+
case "fail": {
|
|
2643
|
+
throw new Error(action.message);
|
|
2644
|
+
}
|
|
2510
2645
|
default:
|
|
2511
2646
|
throw new Error(`Unsupported action type: ${action.type}`);
|
|
2512
2647
|
}
|
|
@@ -2931,7 +3066,7 @@ async function runWorkflow(workflow, workflowFilePath, options = {}) {
|
|
|
2931
3066
|
const browserName = options.browser ?? workflow.config?.web?.browser ?? "chromium";
|
|
2932
3067
|
const headless = options.headed === true ? false : workflow.config?.web?.headless ?? true;
|
|
2933
3068
|
console.log(`Launching ${browserName}${headless ? " (headless)" : " (visible)"}...`);
|
|
2934
|
-
const browser = await getBrowser2(browserName).launch({ headless });
|
|
3069
|
+
const browser = await getBrowser2(browserName).launch(getBrowserLaunchOptions({ headless, browser: browserName }));
|
|
2935
3070
|
console.log(`Browser launched successfully`);
|
|
2936
3071
|
const browserContext = await browser.newContext();
|
|
2937
3072
|
const page = await browserContext.newPage();
|
|
@@ -3083,6 +3218,7 @@ exports.generateRandomEmail = generateRandomEmail;
|
|
|
3083
3218
|
exports.generateRandomPhone = generateRandomPhone;
|
|
3084
3219
|
exports.generateRandomPhoto = generateRandomPhoto;
|
|
3085
3220
|
exports.generateRandomUsername = generateRandomUsername;
|
|
3221
|
+
exports.getBrowserLaunchOptions = getBrowserLaunchOptions;
|
|
3086
3222
|
exports.interpolateVariables = interpolateVariables;
|
|
3087
3223
|
exports.isPipelineContent = isPipelineContent;
|
|
3088
3224
|
exports.isPipelineFile = isPipelineFile;
|
|
@@ -3104,5 +3240,5 @@ exports.runWorkflowWithContext = runWorkflowWithContext;
|
|
|
3104
3240
|
exports.setupAppwriteTracking = setupAppwriteTracking;
|
|
3105
3241
|
exports.startTrackingServer = startTrackingServer;
|
|
3106
3242
|
exports.startWebServer = startWebServer;
|
|
3107
|
-
//# sourceMappingURL=chunk-
|
|
3108
|
-
//# sourceMappingURL=chunk-
|
|
3243
|
+
//# sourceMappingURL=chunk-GFN6LIOF.cjs.map
|
|
3244
|
+
//# sourceMappingURL=chunk-GFN6LIOF.cjs.map
|