Skip to content

Commit

Permalink
remove fake file for streams, it is not compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
shaed-parkar committed Jan 10, 2025
1 parent 47fe6e8 commit e6eaa17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion UI.AutomationTests/CommonUiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion UI.AutomationTests/Drivers/LocalChromeVhDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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();
Expand Down
19 changes: 3 additions & 16 deletions UI.AutomationTests/Drivers/RemoteChromeVhDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e6eaa17

Please sign in to comment.