Skip to content

Commit

Permalink
Updating comments about the usage of the --no-sandbox switch in WebDr…
Browse files Browse the repository at this point in the history
…iverFactory
  • Loading branch information
BenedekFarkas committed Oct 30, 2024
1 parent a457833 commit 84d77a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public static Task<Func<ChromeDriver>> CreateChromeDriverAsync(BrowserConfigurat
Task<Func<ChromeDriver>> CreateDriverInnerAsync(string driverPath = null) =>
Task.FromResult(() =>
{
// Note that no-sandbox should NOT be used, because it causes Chrome processes to remain open, see
// https://github.com/Lombiq/UI-Testing-Toolbox/issues/356.
var chromeConfig = new ChromeConfiguration { Options = new ChromeOptions().SetCommonOptions() };
chromeConfig.Options.SetLoggingPreference(LogType.Browser, LogLevel.Info);
Expand Down Expand Up @@ -144,7 +141,6 @@ private static TDriverOptions SetCommonChromiumOptions<TDriverOptions>(
BrowserConfiguration configuration)
where TDriverOptions : ChromiumOptions
{
options.AddArgument("--no-sandbox"); // #spell-check-ignore-line
options.AddArgument("--lang=" + configuration.AcceptLanguage);

// Disabling hardware acceleration to avoid hardware dependent issues in rendering and visual validation.
Expand All @@ -161,6 +157,12 @@ private static TDriverOptions SetCommonChromiumOptions<TDriverOptions>(
// Disabling smooth scrolling to avoid large waiting time when taking full-page screenshots.
options.AddArgument("disable-smooth-scrolling");

// Previously this switch caused Chrome processes to remain open after test execution, see
// https://github.com/Lombiq/UI-Testing-Toolbox/issues/356, but it doesn't seem to be case anymore.
// Additionally, Ubuntu 2024-based GitHub Actions runners seem to require this flag to be set, see
// https://github.com/actions/runner-images/issues/8268#issuecomment-2343831000.
options.AddArgument("--no-sandbox");

if (configuration.FakeVideoSource is not null)
{
var fakeCameraSourceFilePath = configuration.FakeVideoSource.SaveVideoToTempFolder();
Expand Down

0 comments on commit 84d77a5

Please sign in to comment.