Skip to content

Commit b2667b7

Browse files
authoredMar 21, 2025
Merge pull request #255 from LambdaTest/stage
Release 4.1.6
2 parents 1c563c8 + f41059a commit b2667b7

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lambdatest/smartui-cli",
3-
"version": "4.1.5",
3+
"version": "4.1.6",
44
"description": "A command line interface (CLI) to run SmartUI tests on LambdaTest",
55
"files": [
66
"dist/**/*"

‎src/lib/processSnapshot.ts

+2
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,8 @@ export default async function processSnapshot(snapshot: Snapshot, ctx: Context):
453453
}
454454
}
455455
}
456+
processedOptions.ignoreDOM = options?.ignoreDOM;
457+
processedOptions.selectDOM = options?.selectDOM;
456458
ctx.log.debug(`Processed options: ${JSON.stringify(processedOptions)}`);
457459
}
458460

‎src/lib/schemaValidation.ts

+5
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ const WebStaticConfigSchema: JSONSchemaType<WebStaticConfig> = {
222222
}
223223
}
224224
},
225+
pageEvent: {
226+
type: "string",
227+
enum: ['load', 'domcontentloaded'],
228+
errorMessage: "pageEvent can be load, domcontentloaded"
229+
},
225230
},
226231
required: ["name", "url"],
227232
additionalProperties: false

‎src/lib/screenshot.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ async function captureScreenshotsForConfig(
1616
): Promise<void> {
1717
ctx.log.debug(`*** urlConfig ${JSON.stringify(urlConfig)}`);
1818

19-
let {name, url, waitForTimeout, execute} = urlConfig;
19+
let {name, url, waitForTimeout, execute, pageEvent} = urlConfig;
2020
let afterNavigationScript = execute?.afterNavigation;
2121
let beforeSnapshotScript = execute?.beforeSnapshot;
22+
let waitUntilEvent = pageEvent || process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || 'load';
2223

23-
let pageOptions = { waitUntil: process.env.SMARTUI_PAGE_WAIT_UNTIL_EVENT || 'load', timeout: ctx.config.waitForPageRender || constants.DEFAULT_PAGE_LOAD_TIMEOUT };
24+
let pageOptions = { waitUntil: waitUntilEvent, timeout: ctx.config.waitForPageRender || constants.DEFAULT_PAGE_LOAD_TIMEOUT };
25+
ctx.log.debug(`url: ${url} pageOptions: ${JSON.stringify(pageOptions)}`);
2426
let ssId = name.toLowerCase().replace(/\s/g, '_');
2527
let context: BrowserContext;
2628
let contextOptions: Record<string, any> = {};

0 commit comments

Comments
 (0)
Failed to load comments.