Skip to content

Commit fee12f2

Browse files
committed
added check for min max for timeout
1 parent c550d40 commit fee12f2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

LambdaTest.Selenium.Driver/SmartUI.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ public static async Task<String> CaptureSnapshot(IWebDriver driver, string name,
118118
// Get Snapshot Status
119119
var timeout=600;
120120
if (options.ContainsKey("timeout")){
121-
timeout= (int)options["timeout"];
121+
var tempTimeout= (int)options["timeout"];
122+
if (tempTimeout<30||tempTimeout>900){
123+
SmartUILogger.LogWarning("Timeout value is out of range(30-900). Defaulting to 600 seconds.");
124+
}else{
125+
timeout=tempTimeout;
126+
}
122127
}
123128
var snapshotStatusJSON = await LambdaTest.Sdk.Utils.SmartUI.GetSnapshotStatus(contextId, timeout, name);
124129
var snapshotStatus = JsonSerializer.Deserialize<ApiResponse>(snapshotStatusJSON, new JsonSerializerOptions { PropertyNameCaseInsensitive = true });

0 commit comments

Comments
 (0)