Skip to content

Commit ea4499e

Browse files
committed
Update BrowserManager.cs
1 parent 8902962 commit ea4499e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Shared/BrowserTesting/src/BrowserManager.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ async Task InitializeCore()
4949
{
5050
// Work around weird driverExecutable lookup logic
5151
var helixDirectory = Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT");
52-
var driverPath = string.IsNullOrEmpty(helixDirectory) ? null : Path.Combine(helixDirectory, "runtests.sh");
53-
Playwright = await PlaywrightSharp.Playwright.CreateAsync(_loggerFactory, driverExecutablePath: driverPath /*, debug: "pw:api"*/);
52+
if (string.IsNullOrEmpty(helixDirectory))
53+
{
54+
var driverPath = Path.Combine(helixDirectory,
55+
RuntimeInformation.IsOSPlatform(OSPlatform.OSX) || RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "playwright.sh" : "playwright.cmd");
56+
Playwright = await PlaywrightSharp.Playwright.CreateAsync(_loggerFactory, driverExecutablePath: driverPath /*, debug: "pw:api"*/);
57+
}
58+
else
59+
{
60+
Playwright = await PlaywrightSharp.Playwright.CreateAsync(_loggerFactory /*, debug: "pw:api"*/);
61+
}
5462
foreach (var (browserName, options) in _browserManagerConfiguration.BrowserOptions)
5563
{
5664
if (!_launchBrowsers.ContainsKey(browserName))

0 commit comments

Comments
 (0)