Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
@@ -0,0 +1,5 @@
{
"GlobalBrowserOptions": {
"ChromiumSandbox": false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public bool IsMet
{
get
{
if (!OperatingSystem.IsWindows())
{
return false;
}

var identity = WindowsIdentity.GetCurrent();
var principal = new WindowsPrincipal(identity);
return principal.IsInRole(WindowsBuiltInRole.Administrator) || SkipInVSTSAttribute.RunningInVSTS;
Expand Down
8 changes: 8 additions & 0 deletions src/Shared/BrowserTesting/src/BrowserTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class BrowserTestBase : LoggedTest, IAsyncLifetime
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ContinuousIntegrationBuild")) ||
!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("Helix"));

private static readonly bool _isContainerEnvironment =
File.Exists("/.dockerenv") || File.Exists("/run/.containerenv");

private static readonly BrowserManagerConfiguration _config = new BrowserManagerConfiguration(CreateConfiguration());

public BrowserTestBase(ITestOutputHelper output = null) : base(output) { }
Expand Down Expand Up @@ -55,6 +58,11 @@ private static IConfiguration CreateConfiguration()
.AddJsonFile(Path.Combine(basePath, $"playwrightSettings.ci.{os}.json"), optional: true);
}

if (_isContainerEnvironment)
{
builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.container.json"), optional: true);
}

if (Debugger.IsAttached)
{
builder.AddJsonFile(Path.Combine(basePath, "playwrightSettings.debug.json"), optional: true);
Expand Down
1 change: 1 addition & 0 deletions src/Shared/E2ETesting/BrowserFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ private async Task DeleteBrowserUserProfileDirectoriesAsync()

opts.AddArgument("--no-sandbox");
opts.AddArgument("--ignore-certificate-errors");
opts.AddArgument("--disable-dev-shm-usage");

// Log errors
opts.SetLoggingPreference(LogType.Browser, LogLevel.All);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

// connect a client and ensure we can invoke a method on the server
var serverUrl = app.Services.GetRequiredService<IServer>().Features.Get<IServerAddressesFeature>().Addresses.First();

// replace IPv6Any/IPv4Any with localhost so that it's a valid address for the client connection
serverUrl = serverUrl.Replace("[::]", "localhost");
serverUrl = serverUrl.Replace("0.0.0.0", "localhost");

var hubConnectionBuilder = new HubConnectionBuilder()
.WithUrl(serverUrl + "/testhub");
AppJsonSerializerContext.AddToJsonHubProtocol(hubConnectionBuilder.Services);
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/src/HelixHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static class HelixHelper
{
public static bool OnHelix() => !string.IsNullOrEmpty(GetTargetHelixQueue());

public static string GetTargetHelixQueue() => Environment.GetEnvironmentVariable("helix");
public static string GetTargetHelixQueue() => Environment.GetEnvironmentVariable("helix") ?? "";

// Uploads the file on helix, or puts the file in your user temp folder when running locally
public static void PreserveFile(string filePath, string uploadFileName)
Expand Down
Loading