Skip to content

Commit

Permalink
chore: ignore GitHub Codespaces BROWSER env var (#3068)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Dec 5, 2024
1 parent c0693a2 commit df59854
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Playwright.TestAdapter/PlaywrightSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ public static string BrowserName
get
{
var browserFromEnv = Environment.GetEnvironmentVariable("BROWSER")?.ToLowerInvariant();
if (!string.IsNullOrEmpty(browserFromEnv))
// GitHub Codespaces sets the BROWSER environment variable, ignore it if its bogus.
var ignoreValueFromEnv = Environment.GetEnvironmentVariable("CODESPACES") == "true" && browserFromEnv!.StartsWith("/vscode/");
if (!string.IsNullOrEmpty(browserFromEnv) && !ignoreValueFromEnv)
{
ValidateBrowserName(browserFromEnv!, "'BROWSER' environment variable", "\nTry to remove 'BROWSER' environment variable for using default browser");
return browserFromEnv!;
Expand Down

0 comments on commit df59854

Please sign in to comment.