From baae58040d16ad7b8df9ab3f09f49dfd580085e8 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 16 Aug 2021 18:38:44 +0100 Subject: [PATCH 01/18] Remove duplicate markup --- .../test/testassets/BasicTestApp/BindCasesComponent.razor | 6 ------ 1 file changed, 6 deletions(-) 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): From 66473d1e73b516fa0abca75ed6cc2f04c5b46c8d Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 16 Aug 2021 18:51:05 +0100 Subject: [PATCH 02/18] Workaround for "unexpected string" issue (seems like a Selenium/WebDriver bug) --- src/Components/test/E2ETest/Tests/BindTest.cs | 6 +++--- src/Components/test/E2ETest/Tests/EventBubblingTest.cs | 6 +++--- src/Components/test/E2ETest/Tests/FormsTest.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) 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/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..b90e347d1c57 100644 --- a/src/Components/test/E2ETest/Tests/FormsTest.cs +++ b/src/Components/test/E2ETest/Tests/FormsTest.cs @@ -809,9 +809,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) From 168eafc1aa0b2b287675716515ba533d48dbb84e Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Mon, 16 Aug 2021 18:59:01 +0100 Subject: [PATCH 03/18] Fix some parsing logic --- .../test/E2ETest/Tests/WebAssemblyAuthenticationTests.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } From 53e883039352a7d48ea3eb3077bde891a4d61cae Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 11:09:45 +0100 Subject: [PATCH 04/18] Workaround for string interpolation bug --- .../testassets/TestServer/Controllers/CultureController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"); } } From c5cc25644733960ae37f1390154e3799469c0d68 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 11:34:29 +0100 Subject: [PATCH 05/18] Another interpolation workaround --- .../ServerInteropTestDefaultExceptionsBehavior.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/test/E2ETest/ServerExecutionTests/ServerInteropTestDefaultExceptionsBehavior.cs b/src/Components/test/E2ETest/ServerExecutionTests/ServerInteropTestDefaultExceptionsBehavior.cs index 2ba799a3bb9c..73baa0e75f06 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/ServerInteropTestDefaultExceptionsBehavior.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/ServerInteropTestDefaultExceptionsBehavior.cs @@ -63,8 +63,8 @@ public void DotNetExceptionDetailsAreNotLoggedByDefault() } string GetExpectedMessage(string method) => - $"\"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) + "'\""; } } } From 3dad549734d9d2289a0f756bba81d32f95e50446 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 11:58:39 +0100 Subject: [PATCH 06/18] Base href is required for loading initializer modules --- .../test/testassets/TestServer/Pages/Transports.cshtml | 9 +++++++++ 1 file changed, 9 insertions(+) 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 @@ }); } + + From 1cfe9c8070c066595b243b134c9314acfa3410e3 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 12:15:50 +0100 Subject: [PATCH 07/18] Make namespaces consistent --- .../ServerExecutionTests/HeadModificationPrerenderingTest.cs | 2 +- src/Components/test/E2ETest/Tests/HeadModificationTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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> { From ad29d710687c70850201b7b723f25261005b562d Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 12:54:06 +0100 Subject: [PATCH 08/18] Fix NavigateOnSubmitWorks test --- src/Components/test/E2ETest/Tests/FormsTest.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Components/test/E2ETest/Tests/FormsTest.cs b/src/Components/test/E2ETest/Tests/FormsTest.cs index b90e347d1c57..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] From 263c3db2a11425a5fe6f5108d5b0dbefcad4d890 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 14:02:16 +0100 Subject: [PATCH 09/18] Fix ClosingTheBrowserWindow_GracefullyDisconnects_TheCurrentCircuit --- .../ServerExecutionTests/CircuitGracefulTerminationTests.cs | 5 ++++- src/Shared/E2ETesting/BrowserFixture.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs index 0665d6346d23..b1de832e9f86 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 sent 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/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"); From 27cf1510ec7009bcdffca04dac14522ac5fdb82f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 14:09:31 +0100 Subject: [PATCH 10/18] Skip all the ignitor tests (they are quarantined anyway, and we'll be removing Ignitor) --- .../ComponentHubInvalidEventTest.cs | 6 ++-- .../InteropReliabilityTests.cs | 36 +++++++++---------- .../RemoteRendererBufferLimitTest.cs | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) 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/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/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 Date: Tue, 17 Aug 2021 14:24:02 +0100 Subject: [PATCH 11/18] Unskip some working tests --- .../test/E2ETest/Tests/ComponentRenderingTestBase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs index b4086d1941f6..4e349f90444b 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(); @@ -725,7 +725,7 @@ public void CanPatchRenderTreeToMatchLatestDOMState() }); } - [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/34857")] + [Fact] public void CanHandleClearedChild() { var appElement = Browser.MountTestComponent(); From e48f884dccaf60dfe9c33e4b2f8eb854c0600d83 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 16:39:46 +0100 Subject: [PATCH 12/18] Experiment with running E2E tests with less parallelism --- src/Components/test/E2ETest/xunit.runner.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 } From 9e11e59eacf9fcc0e9378e762c90fee43a51e970 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 17:26:45 +0100 Subject: [PATCH 13/18] Remove a SWA hint that seems wrong --- src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj | 2 -- 1 file changed, 2 deletions(-) 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 From f7ce8516259b30fb8bc3081fda87fc9d47958e4d Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 17 Aug 2021 18:01:57 +0100 Subject: [PATCH 14/18] Fix intermittent issue with subpixel positioning --- src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs index 4e349f90444b..6bd25034562a 100644 --- a/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs +++ b/src/Components/test/E2ETest/Tests/ComponentRenderingTestBase.cs @@ -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] From a2aec405d23c5403a5aaaee186a2f85d6c5e0222 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 18 Aug 2021 10:54:03 +0100 Subject: [PATCH 15/18] Stop using "noreload" optimization to see if it helps with consistency --- .../WebDriverExtensions/WebDriverExtensions.cs | 9 --------- 1 file changed, 9 deletions(-) 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); } From f6bedec0e727e40a44187a8d3cf90c4fd6554a48 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 18 Aug 2021 11:27:23 +0100 Subject: [PATCH 16/18] Also run the quarantined tests on CI. They all pass locally. --- .azure/pipelines/components-e2e-tests.yml | 1 + 1 file changed, 1 insertion(+) 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 From 51a9f82912c4da3b6189aa8ce7db9e1a3e97ea37 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 18 Aug 2021 12:43:25 +0100 Subject: [PATCH 17/18] Skip problematic test --- .../test/E2ETest/ServerExecutionTests/PrerenderingTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); From 915d35e5945147b151c4a47198788985fe78bec5 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 18 Aug 2021 16:02:33 +0100 Subject: [PATCH 18/18] Update src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs Co-authored-by: Tanay Parikh --- .../ServerExecutionTests/CircuitGracefulTerminationTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs b/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs index b1de832e9f86..1b326af871ea 100644 --- a/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs +++ b/src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs @@ -26,7 +26,7 @@ public CircuitGracefulTerminationTests( ITestOutputHelper output) : base(browserFixture, serverFixture, output) { - // The browser won't sent the disconnection message if it's headless + // The browser won't send the disconnection message if it's headless browserFixture.EnsureNotHeadless = true; }