V4.4 Selenium fix

This commit is contained in:
2025-11-11 13:18:02 +00:00
parent 42a4778555
commit a91c3b846f
5 changed files with 96 additions and 27 deletions

View File

@@ -1575,7 +1575,7 @@ namespace AiQ_GUI
CancellationTokenSource cts = new();
soakCtsList.Add(cts);
soakTasks.Add(SoakTest.StartSoak(SCL, cts.Token));
await Task.Delay(5000);
await Task.Delay(10000);
}
}
else
@@ -1586,28 +1586,23 @@ namespace AiQ_GUI
cts.Cancel();
soakCtsList.Clear();
soakTasks.Clear();
int i = soakCameraList.Count + 1; // Add 1 for 211 itself staying in the list
foreach (Camera SCL in soakCameraList) // Reset all cameras that were being soaked to default module settings
string[,] Network_JSON = { { "propDHCP", "false" }, { "propHost", "192.168.1.211" }, { "propNetmask", "255.255.255.0" }, { "propGateway", "192.168.1.1" } };
string[,] GOD_JSON = { { "propGodMode", "false" } };
foreach (Camera SCL in soakCameraList.Where(c => c.IsChecked)) // only checked cameras
{
if (!SCL.IsChecked)
continue;
try
{
Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera, cannot be done in soak test finally becuase of this.
Network.Initialize("developer", SCL.DevPass); // Ensure network is initialized to the right camera
await CameraModules.FactoryResetModules(SCL.IP); // Reset camera modules
string[,] godJson = { { "propGodMode", "false" } }; // Set God mode explicitly off
string GOD = await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, godJson);
if (GOD.Contains("Error"))
throw new Exception("Could not set God mode off");
bool Pass = await FlexiAPI.ChangeNetwork211(SCL.IP); // set camera to 211
if (!Pass)
throw new Exception("Could not set camera to 211");
await FlexiAPI.HTTP_Update("GLOBAL--FlexiApplication", SCL.IP, GOD_JSON);
await FlexiAPI.HTTP_Update("GLOBAL--NetworkConfig", SCL.IP, Network_JSON);
AddToActionsList($"Setting 211 & God Mode off for camera {SCL.IP}", false);
}
catch (Exception ex)
{
AddToActionsList("Failed to set God mode, reset camera modules or 211 for camera " + SCL.IP + ". Reason: " + ex.Message);
AddToActionsList("Failed to set all cameras to 211 and god mode off. Reason: " + ex.Message); // In case non AiQ's get caught up
}
}
}