diff --git a/UI.AutomationTests/CommonUiTest.cs b/UI.AutomationTests/CommonUiTest.cs index 5af5992a..df07994f 100644 --- a/UI.AutomationTests/CommonUiTest.cs +++ b/UI.AutomationTests/CommonUiTest.cs @@ -90,7 +90,7 @@ protected IVhDriver CreateDriver(string username, string videoFileName = null) } else { - driver = new RemoteChromeVhDriver(username: username, videoFileName:videoFileName); + driver = new RemoteChromeVhDriver(username: username); } driver.GetDriver().StoreUsername(username); diff --git a/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs b/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs index 77fe1306..6acbb129 100644 --- a/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs +++ b/UI.AutomationTests/Drivers/LocalChromeVhDriver.cs @@ -16,6 +16,7 @@ public LocalChromeVhDriver(string videoFileName = null) chromeOptions.AddArgument("--start-maximized"); chromeOptions.AddArgument("--no-sandbox"); chromeOptions.AddArgument("--mute-audio"); + chromeOptions.AddArgument("--use-fake-device-for-media-stream"); if (videoFileName != null) { @@ -27,7 +28,6 @@ public LocalChromeVhDriver(string videoFileName = null) chromeOptions.AddArgument($"--use-file-for-fake-video-capture={videoFilePath}"); } else { chromeOptions.AddArgument("--use-fake-ui-for-media-stream"); - chromeOptions.AddArgument("--use-fake-device-for-media-stream"); } var envConfigSettings = ConfigRootBuilder.EnvConfigInstance(); diff --git a/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs b/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs index 6617996a..d8905038 100644 --- a/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs +++ b/UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs @@ -9,7 +9,7 @@ public class RemoteChromeVhDriver : IVhDriver private RemoteWebDriver _driver; public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersion = "latest", - string username = null, string videoFileName = null) + string username = null) { var envConfigSettings = ConfigRootBuilder.EnvConfigInstance(); var chromeOptions = new ChromeOptions @@ -20,21 +20,8 @@ public RemoteChromeVhDriver(string platform = "Windows 11", string browserVersio chromeOptions.AddArguments("start-maximized"); chromeOptions.AddArgument("no-sandbox"); - - if (videoFileName != null) - { - var videoFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "MockVideos", videoFileName); - if (!File.Exists(videoFilePath)) - { - throw new FileNotFoundException($"Video file not found: {videoFilePath}"); - } - chromeOptions.AddArgument($"--use-file-for-fake-video-capture={videoFilePath}"); - } - else - { - chromeOptions.AddArguments("--use-fake-ui-for-media-stream"); - chromeOptions.AddArguments("--use-fake-device-for-media-stream"); - } + chromeOptions.AddArguments("--use-fake-ui-for-media-stream"); + chromeOptions.AddArguments("--use-fake-device-for-media-stream"); // this is the name for a build in SauceLabs var buildName = Environment.GetEnvironmentVariable("TF_BUILD") == null