diff --git a/.azure/pipelines/components-e2e-tests.yml b/.azure/pipelines/components-e2e-tests.yml index 322649488141..ed817d303921 100644 --- a/.azure/pipelines/components-e2e-tests.yml +++ b/.azure/pipelines/components-e2e-tests.yml @@ -42,6 +42,7 @@ stages: cancelTimeoutInMinutes: 30 buildArgs: -all -test /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false + /p:RunQuarantinedTests=true beforeBuild: - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" displayName: Setup IISExpress test certificates and schema diff --git a/src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs b/src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs index 0d0067f6c1c2..969082ceb896 100644 --- a/src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs +++ b/src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs @@ -15,15 +15,6 @@ public static void Navigate(this IWebDriver browser, Uri baseUri, string relativ { var absoluteUrl = new Uri(baseUri, relativeUrl); - if (noReload) - { - var existingUrl = browser.Url; - if (string.Equals(existingUrl, absoluteUrl.AbsoluteUri, StringComparison.Ordinal)) - { - return; - } - } - browser.Navigate().GoToUrl("about:blank"); browser.Navigate().GoToUrl(absoluteUrl); } diff --git a/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs index 0665d6346d23..1b326af871ea 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs @@ -26,6 +26,8 @@ public CircuitGracefulTerminationTests( ITestOutputHelper output) : base(browserFixture, serverFixture, output) { + // The browser won't send the disconnection message if it's headless + browserFixture.EnsureNotHeadless = true; } public TaskCompletionSource GracefulDisconnectCompletionSource { get; private set; } @@ -65,7 +67,7 @@ public async Task ReloadingThePage_GracefullyDisconnects_TheCurrentCircuit() Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages); } - [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/23015")] + [Fact] public async Task ClosingTheBrowserWindow_GracefullyDisconnects_TheCurrentCircuit() { // Arrange & Act @@ -73,6 +75,7 @@ public async Task ClosingTheBrowserWindow_GracefullyDisconnects_TheCurrentCircui await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task); // Assert + Assert.True(GracefulDisconnectCompletionSource.Task.IsCompletedSuccessfully); Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages); Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages); } diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs index 7c573a1362fc..3cc5c8a117d6 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs @@ -33,7 +33,7 @@ protected override async Task InitializeAsync() Assert.Equal(2, Batches.Count); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingAnInvalidEventArgument_DoesNotProduceWarnings() { // Arrange @@ -59,7 +59,7 @@ await Client.ExpectCircuitError(() => Client.HubConnection.SendAsync( Assert.Contains(Logs, l => (l.LogLevel, l.Exception?.Message) == (LogLevel.Debug, "There was an error parsing the event arguments. EventId: '3'.")); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingAnInvalidEvent_DoesNotTriggerWarnings() { // Arrange @@ -98,7 +98,7 @@ await Client.ExpectCircuitError(() => Client.HubConnection.SendAsync( "There is no event handler associated with this event. EventId: '1990'. (Parameter 'eventHandlerId')")); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingAnInvalidRenderAcknowledgement_DoesNotTriggerWarnings() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs index 609a2b4c7902..ab29926a26f4 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs @@ -9,7 +9,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.AspNetCore.Components.E2ETests.ServerExecutionTests +namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests { public class HeadModificationPrerenderingTest : ServerTestBase> { diff --git a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs index 11f401c3444a..5b7c6bba95c6 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs @@ -36,7 +36,7 @@ protected override async Task InitializeAsync() Assert.Equal(2, Batches.Count); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeNonJSInvokableMethods() { // Arrange @@ -57,7 +57,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeNonExistingMethods() { // Arrange @@ -78,7 +78,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsWithWrongNumberOfArguments() { // Arrange @@ -99,7 +99,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsEmptyAssemblyName() { // Arrange @@ -120,7 +120,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsEmptyMethodName() { // Arrange @@ -142,7 +142,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsWithWrongReferenceId() { // Arrange @@ -182,7 +182,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsWrongReferenceIdType() { // Arrange @@ -213,7 +213,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task ContinuesWorkingAfterInvalidAsyncReturnCallback() { // Arrange @@ -242,7 +242,7 @@ await Client.HubConnection.InvokeAsync( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task JSInteropCompletionSuccess() { // Arrange @@ -271,7 +271,7 @@ await Client.HubConnection.InvokeAsync( Assert.Equal(LogLevel.Debug, entry.LogLevel); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task JSInteropThrowsInUserCode() { // Arrange @@ -304,7 +304,7 @@ await Client.HubConnection.InvokeAsync( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task MalformedJSInteropCallbackDisposesCircuit() { // Arrange @@ -339,7 +339,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () => }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsWithInvalidArgumentsPayload() { // Arrange @@ -360,7 +360,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task CannotInvokeJSInvokableMethodsWithMalformedArgumentPayload() { // Arrange @@ -381,7 +381,7 @@ await Client.InvokeDotNetMethod( await ValidateClientKeepsWorking(Client, Batches); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingEventsWithInvalidPayloadsShutsDownCircuitGracefully() { // Arrange @@ -405,7 +405,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () => }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingEventsWithInvalidEventDescriptor() { // Arrange @@ -429,7 +429,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () => }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingEventsWithInvalidEventArgs() { // Arrange @@ -461,7 +461,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () => }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task DispatchingEventsWithInvalidEventHandlerId() { // Arrange @@ -495,7 +495,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () => }); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")] public async Task EventHandlerThrowsSyncExceptionTerminatesTheCircuit() { // Arrange diff --git a/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs index f5961126c68d..36ca4f14f55b 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs @@ -135,7 +135,7 @@ public void CanAccessAuthenticationStateDuringStaticPrerendering(string initialU Browser.Equal($"Hello, {interactiveUsername ?? "anonymous"}!", () => Browser.Exists(By.TagName("h1")).Text); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/35449")] public async Task NoHotReloadListenersAreOrdinarilyRegistered() { Navigate("/prerendered/prerendered-transition"); diff --git a/src/Components/test/E2ETest/ServerExecutionTests/RemoteRendererBufferLimitTest.cs b/src/Components/test/E2ETest/ServerExecutionTests/RemoteRendererBufferLimitTest.cs index 375b386ff577..53ed5dc39e63 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/RemoteRendererBufferLimitTest.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/RemoteRendererBufferLimitTest.cs @@ -22,7 +22,7 @@ public RemoteRendererBufferLimitTest(BasicTestAppServerSiteFixture - $"\"There was an exception invoking '{method}' on assembly 'BasicTestApp'. For more details turn on " + - $"detailed exceptions in '{typeof(CircuitOptions).Name}.{nameof(CircuitOptions.DetailedErrors)}'\""; + "\"There was an exception invoking '" + method + "' on assembly 'BasicTestApp'. For more details turn on " + + "detailed exceptions in '" + typeof(CircuitOptions).Name + "." + nameof(CircuitOptions.DetailedErrors) + "'\""; } } } diff --git a/src/Components/test/E2ETest/Tests/BindTest.cs b/src/Components/test/E2ETest/Tests/BindTest.cs index 50b871d01202..54abec28e8c7 100644 --- a/src/Components/test/E2ETest/Tests/BindTest.cs +++ b/src/Components/test/E2ETest/Tests/BindTest.cs @@ -2022,9 +2022,9 @@ private void ApplyInputValue(string cssSelector, string value) // interaction as authentically as SendKeys in other cases. var javascript = (IJavaScriptExecutor)Browser; javascript.ExecuteScript( - $"var elem = document.querySelector('{cssSelector}');" - + $"elem.value = '{value}';" - + "elem.dispatchEvent(new KeyboardEvent('change'));"); + $"document.querySelector('{cssSelector}').value = '{value}'"); + javascript.ExecuteScript( + $"document.querySelector('{cssSelector}').dispatchEvent(new KeyboardEvent('change'));"); } } } diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs index b4086d1941f6..6bd25034562a 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs @@ -320,7 +320,7 @@ public void CanUseViewImportsHierarchically() elem => Assert.Equal(typeof(AssemblyHashAlgorithm).FullName, elem.Text)); } - [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/34679")] + [Fact] public void CanUseComponentAndStaticContentFromExternalNuGetPackage() { var appElement = Browser.MountTestComponent(); @@ -463,7 +463,7 @@ public void CanUseFocusExtensionToFocusElementPreventScroll() string getFocusedElementId() => Browser.SwitchTo().ActiveElement().GetAttribute("id"); // A local helper that gets window.PageYOffset - long getPageYOffset() => (long)((IJavaScriptExecutor)Browser).ExecuteScript("return window.pageYOffset"); + long getPageYOffset() => (long)((IJavaScriptExecutor)Browser).ExecuteScript("return Math.round(window.pageYOffset)"); } [Theory] @@ -725,7 +725,7 @@ public void CanPatchRenderTreeToMatchLatestDOMState() }); } - [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/34857")] + [Fact] public void CanHandleClearedChild() { var appElement = Browser.MountTestComponent(); diff --git a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs index 115c0faf170f..d902cfc054be 100644 --- a/src/Components/test/E2ETest/Tests/EventBubblingTest.cs +++ b/src/Components/test/E2ETest/Tests/EventBubblingTest.cs @@ -201,9 +201,9 @@ private void TriggerCustomBubblingEvent(string elementId, string eventName) { var jsExecutor = (IJavaScriptExecutor)Browser; jsExecutor.ExecuteScript( - $"document.getElementById('{elementId}').dispatchEvent(" + - $" new Event('{eventName}', {{ bubbles: true }})" + - $")"); + $"window.testelem = document.getElementById('{elementId}')"); + jsExecutor.ExecuteScript( + $"window.testelem.dispatchEvent(new Event('{eventName}', {{ bubbles: true }}))"); } } } diff --git a/src/Components/test/E2ETest/Tests/FormsTest.cs b/src/Components/test/E2ETest/Tests/FormsTest.cs index 050049982e2e..d1bbdf36f910 100644 --- a/src/Components/test/E2ETest/Tests/FormsTest.cs +++ b/src/Components/test/E2ETest/Tests/FormsTest.cs @@ -739,16 +739,15 @@ public void RespectsCustomFieldCssClassProvider() Browser.Equal("modified invalid-socks", () => socksInput.GetAttribute("class")); } - [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/34857")] + [Fact] public void NavigateOnSubmitWorks() { var app = Browser.MountTestComponent(); var input = app.FindElement(By.Id("text-input")); - input.SendKeys("Enter"); + input.SendKeys(Keys.Enter); - var log = Browser.Manage().Logs.GetLog(LogType.Browser); - Assert.DoesNotContain(log, entry => entry.Level == LogLevel.Severe); + Browser.Equal("Choose...", () => Browser.WaitUntilTestSelectorReady().SelectedOption.Text); } [Fact] @@ -809,9 +808,9 @@ private void ApplyInvalidInputDateValue(string cssSelector, string invalidValue) // interaction as authentically as SendKeys in other cases. var javascript = (IJavaScriptExecutor)Browser; javascript.ExecuteScript( - $"var elem = document.querySelector('{cssSelector}');" - + $"elem.value = {JsonSerializer.Serialize(invalidValue, TestJsonSerializerOptionsProvider.Options)};" - + "elem.dispatchEvent(new KeyboardEvent('change'));"); + $"document.querySelector('{cssSelector}').value = {JsonSerializer.Serialize(invalidValue, TestJsonSerializerOptionsProvider.Options)}"); + javascript.ExecuteScript( + $"document.querySelector('{cssSelector}').dispatchEvent(new KeyboardEvent('change'))"); } private void EnsureAttributeRendering(IWebElement element, string attributeName, bool shouldBeRendered = true) diff --git a/src/Components/test/E2ETest/Tests/HeadModificationTest.cs b/src/Components/test/E2ETest/Tests/HeadModificationTest.cs index 2ec264f99633..a98182e8bad5 100644 --- a/src/Components/test/E2ETest/Tests/HeadModificationTest.cs +++ b/src/Components/test/E2ETest/Tests/HeadModificationTest.cs @@ -10,7 +10,7 @@ using Xunit; using Xunit.Abstractions; -namespace Microsoft.AspNetCore.Components.E2ETests.Tests +namespace Microsoft.AspNetCore.Components.E2ETest.Tests { public class HeadModificationTest : ServerTestBase> { diff --git a/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs b/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs index b59e11be7812..5bb5d369e507 100644 --- a/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs +++ b/src/Components/test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs @@ -207,8 +207,10 @@ public void AuthenticatedUser_ProfileIncludesDetails_And_AccessToken() }, payload.Scopes.OrderBy(id => id)); - var currentTime = DateTimeOffset.Parse(Browser.Exists(By.Id("current-time")).Text, CultureInfo.InvariantCulture); - var tokenExpiration = DateTimeOffset.Parse(Browser.Exists(By.Id("access-token-expires")).Text, CultureInfo.InvariantCulture); + // The browser formats the text using the current language, so the following parsing relies on + // the server being set to an equivalent culture. This should be true in our test scenarios. + var currentTime = DateTimeOffset.Parse(Browser.Exists(By.Id("current-time")).Text, CultureInfo.CurrentCulture); + var tokenExpiration = DateTimeOffset.Parse(Browser.Exists(By.Id("access-token-expires")).Text, CultureInfo.CurrentCulture); Assert.True(currentTime.AddMinutes(50) < tokenExpiration); Assert.True(currentTime.AddMinutes(60) >= tokenExpiration); } diff --git a/src/Components/test/E2ETest/xunit.runner.json b/src/Components/test/E2ETest/xunit.runner.json index baa05fb93d2a..d9125313856e 100644 --- a/src/Components/test/E2ETest/xunit.runner.json +++ b/src/Components/test/E2ETest/xunit.runner.json @@ -1,7 +1,6 @@ { - // This is set to -1 to allow the usage of an - // unlimited ammount of threads. - "maxParallelThreads": -1, "diagnosticMessages": true, - "longRunningTestSeconds": 30 + "longRunningTestSeconds": 30, + "parallelizeAssembly": false, + "parallelizeTestCollections": false } diff --git a/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj b/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj index 3033eb876c55..476107e41440 100644 --- a/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj +++ b/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj @@ -14,8 +14,6 @@ - /subdir - <_BlazorBrotliCompressionLevel>NoCompression diff --git a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor index d0bb9b8c81e8..2b04292aeec9 100644 --- a/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor +++ b/src/Components/test/testassets/BasicTestApp/BindCasesComponent.razor @@ -167,12 +167,6 @@ @textboxDateTimeFormatValue

-

- DateTime (format): - - @textboxDateTimeFormatValue - -

DateTime (format / invalid value): diff --git a/src/Components/test/testassets/TestServer/Controllers/CultureController.cs b/src/Components/test/testassets/TestServer/Controllers/CultureController.cs index 735191d92863..93f02a1f7ea8 100644 --- a/src/Components/test/testassets/TestServer/Controllers/CultureController.cs +++ b/src/Components/test/testassets/TestServer/Controllers/CultureController.cs @@ -22,8 +22,8 @@ public IActionResult SetCulture(string culture, string redirectUri) } var htmlEncoder = HtmlEncoder.Default; - var html = $"

Culture has been changed to {htmlEncoder.Encode(culture)}

" + - $"Return to previous page"; + var html = "

Culture has been changed to " + htmlEncoder.Encode(culture) + "

" + + "Return to previous page"; return Content(html, "text/html"); } } diff --git a/src/Components/test/testassets/TestServer/Pages/Transports.cshtml b/src/Components/test/testassets/TestServer/Pages/Transports.cshtml index 6bf003a7b693..2476db63eb8b 100644 --- a/src/Components/test/testassets/TestServer/Pages/Transports.cshtml +++ b/src/Components/test/testassets/TestServer/Pages/Transports.cshtml @@ -1,6 +1,13 @@ @page @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" + + + + + + +
@@ -58,3 +65,5 @@ }); } + + diff --git a/src/Shared/E2ETesting/BrowserFixture.cs b/src/Shared/E2ETesting/BrowserFixture.cs index 6f1729619697..6911226e5578 100644 --- a/src/Shared/E2ETesting/BrowserFixture.cs +++ b/src/Shared/E2ETesting/BrowserFixture.cs @@ -35,6 +35,8 @@ public BrowserFixture(IMessageSink diagnosticsMessageSink) public string UserProfileDir { get; private set; } + public bool EnsureNotHeadless { get; set; } + public static void EnforceSupportedConfigurations() { // Do not change the current platform support without explicit approval. @@ -143,7 +145,8 @@ private async Task DeleteBrowserUserProfileDirectoriesAsync() // Force language to english for tests opts.AddUserProfilePreference("intl.accept_languages", "en"); - if (!Debugger.IsAttached && + if (!EnsureNotHeadless && + !Debugger.IsAttached && !string.Equals(Environment.GetEnvironmentVariable("E2E_TEST_VISIBLE"), "true", StringComparison.OrdinalIgnoreCase)) { opts.AddArgument("--headless");