Skip to content

Commit d57f8b9

Browse files
committed
added check for min max allowed value for timeout
1 parent 10eee3b commit d57f8b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/selenium/src/smartui.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ async function smartuiSnapshot(driver, name, options = {}) {
3131
let { body } = await utils.postSnapshot({url, name, dom, options}, pkgName);
3232
if (body && body.data && body.data.warnings?.length !== 0) body.data.warnings.map(e => log.warn(e));
3333
log.info(`Snapshot captured: ${name}`);
34-
let snapshotStatus = await utils.getSnapshotStatus(options.contextId,name,options?.timeout);
34+
let timeout = options?.timeout || 600;
35+
if(timeout<30||timeout>900){
36+
log.info(`Timeout value must be between 30 and 900 seconds. Using default value of 600 seconds.`);
37+
timeout = 600;
38+
}
39+
let snapshotStatus = await utils.getSnapshotStatus(options.contextId,name,timeout);
3540
return snapshotStatus.body;
3641
}
3742
else{

0 commit comments

Comments
 (0)