Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-668: "Creating the web driver failed" exception recently on GitHub-hosted Linux runners for Edge in Lombiq.UITestingToolbox #308

Merged
merged 7 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Task VerifyBlogImage(Browser browser) =>
// is the different rendering of text on each platform, but it can occur between different Linux distributions too.
// Here: https://pandasauce.org/post/linux-fonts/ you can find a good summary about this from 2019, but still valid
// in 2022.
[Theory, Chrome]
[Theory, Chrome, Edge]
public Task VerifyNavbar(Browser browser) =>
ExecuteTestAfterSetupAsync(
context =>
Expand Down
12 changes: 12 additions & 0 deletions Lombiq.Tests.UI/Services/WebDriverFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Atata.WebDriverSetup;
using Lombiq.HelpfulLibraries.Cli.Helpers;
using Lombiq.Tests.UI.Extensions;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
Expand All @@ -8,6 +9,8 @@
using OpenQA.Selenium.IE;
using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;

namespace Lombiq.Tests.UI.Services;

Expand Down Expand Up @@ -64,6 +67,15 @@ public static EdgeDriver CreateEdgeDriver(BrowserConfiguration configuration, Ti

options.SetCommonChromiumOptions(configuration);

// While the Edge driver easily locates Edge in Windows, it struggles in Linux, where the different release
// channels have different executable names. This setting looks up the "microsoft-edge-stable" command and
// sets the full path as the browser's binary location.
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
CliWrapHelper.WhichAsync("microsoft-edge-stable").GetAwaiter().GetResult().FirstOrDefault() is { } binaryLocation)
Piedone marked this conversation as resolved.
Show resolved Hide resolved
Piedone marked this conversation as resolved.
Show resolved Hide resolved
{
options.BinaryLocation = binaryLocation.FullName;
}

configuration.BrowserOptionsConfigurator?.Invoke(options);

var service = EdgeDriverService.CreateDefaultService();
Expand Down