Skip to content

Commit

Permalink
VIH-11184 fix locator for hand raised icon
Browse files Browse the repository at this point in the history
Provide fake video streams instead of default green circles
  • Loading branch information
shaed-parkar committed Jan 6, 2025
1 parent 2b5e745 commit f576bad
Show file tree
Hide file tree
Showing 16 changed files with 720 additions and 35 deletions.
4 changes: 2 additions & 2 deletions UI.AutomationTests/CommonUiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ protected async Task OneTimeTearDown()
await DeleteUsers();
}

protected IVhDriver CreateDriver(string username)
protected IVhDriver CreateDriver(string username, string videoFileName = null)
{
ArgumentNullException.ThrowIfNull(username);
var envConfigSettings = ConfigRootBuilder.EnvConfigInstance();
IVhDriver driver;
if (envConfigSettings.RunHeadlessBrowser || !envConfigSettings.RunOnSauceLabs)
{
driver = new LocalChromeVhDriver();
driver = new LocalChromeVhDriver(videoFileName);
}
else
{
Expand Down
14 changes: 11 additions & 3 deletions UI.AutomationTests/Drivers/LocalChromeVhDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class LocalChromeVhDriver : IVhDriver
{
private IWebDriver _driver;

public LocalChromeVhDriver()
public LocalChromeVhDriver(string videoFileName = null)
{
// download the latest chrome
new DriverManager().SetUpDriver(new ChromeConfig());
Expand All @@ -19,13 +19,21 @@ public LocalChromeVhDriver()
chromeOptions.AddArgument("--use-fake-ui-for-media-stream");
chromeOptions.AddArgument("--use-fake-device-for-media-stream");

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}");
}

var envConfigSettings = ConfigRootBuilder.EnvConfigInstance();
if (envConfigSettings.RunHeadlessBrowser)
{
chromeOptions.AddArgument("--disable-dev-shm-usage"); // Overcome limited resource problems
chromeOptions.AddArgument("--headless"); // Run in headless mode if needed
// chromeOptions.AddArgument("--disable-gpu"); // Applicable to Windows OS only
// chromeOptions.AddArgument("--remote-debugging-port=9230"); // Debugging port
}
_driver = new ChromeDriver(chromeOptions);
var lang = (string)((IJavaScriptExecutor)_driver).ExecuteScript("return navigator.language || navigator.userLanguage");
Expand Down
127 changes: 127 additions & 0 deletions UI.AutomationTests/MockVideos/clerk.y4m

Large diffs are not rendered by default.

127 changes: 127 additions & 0 deletions UI.AutomationTests/MockVideos/individual01.y4m

Large diffs are not rendered by default.

Loading

0 comments on commit f576bad

Please sign in to comment.