Skip to content

Commit 10e3fe3

Browse files
E2E test fixes (#35414)
1 parent 08bdcfd commit 10e3fe3

21 files changed

+69
-70
lines changed

.azure/pipelines/components-e2e-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ stages:
4242
cancelTimeoutInMinutes: 30
4343
buildArgs: -all -test /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
4444
/p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false
45+
/p:RunQuarantinedTests=true
4546
beforeBuild:
4647
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
4748
displayName: Setup IISExpress test certificates and schema

src/Components/test/E2ETest/Infrastructure/WebDriverExtensions/WebDriverExtensions.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ public static void Navigate(this IWebDriver browser, Uri baseUri, string relativ
1515
{
1616
var absoluteUrl = new Uri(baseUri, relativeUrl);
1717

18-
if (noReload)
19-
{
20-
var existingUrl = browser.Url;
21-
if (string.Equals(existingUrl, absoluteUrl.AbsoluteUri, StringComparison.Ordinal))
22-
{
23-
return;
24-
}
25-
}
26-
2718
browser.Navigate().GoToUrl("about:blank");
2819
browser.Navigate().GoToUrl(absoluteUrl);
2920
}

src/Components/test/E2ETest/ServerExecutionTests/CircuitGracefulTerminationTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public CircuitGracefulTerminationTests(
2626
ITestOutputHelper output)
2727
: base(browserFixture, serverFixture, output)
2828
{
29+
// The browser won't send the disconnection message if it's headless
30+
browserFixture.EnsureNotHeadless = true;
2931
}
3032

3133
public TaskCompletionSource<object> GracefulDisconnectCompletionSource { get; private set; }
@@ -65,14 +67,15 @@ public async Task ReloadingThePage_GracefullyDisconnects_TheCurrentCircuit()
6567
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
6668
}
6769

68-
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/23015")]
70+
[Fact]
6971
public async Task ClosingTheBrowserWindow_GracefullyDisconnects_TheCurrentCircuit()
7072
{
7173
// Arrange & Act
7274
Browser.Close();
7375
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);
7476

7577
// Assert
78+
Assert.True(GracefulDisconnectCompletionSource.Task.IsCompletedSuccessfully);
7679
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
7780
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
7881
}

src/Components/test/E2ETest/ServerExecutionTests/ComponentHubInvalidEventTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected override async Task InitializeAsync()
3333
Assert.Equal(2, Batches.Count);
3434
}
3535

36-
[Fact]
36+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
3737
public async Task DispatchingAnInvalidEventArgument_DoesNotProduceWarnings()
3838
{
3939
// Arrange
@@ -59,7 +59,7 @@ await Client.ExpectCircuitError(() => Client.HubConnection.SendAsync(
5959
Assert.Contains(Logs, l => (l.LogLevel, l.Exception?.Message) == (LogLevel.Debug, "There was an error parsing the event arguments. EventId: '3'."));
6060
}
6161

62-
[Fact]
62+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
6363
public async Task DispatchingAnInvalidEvent_DoesNotTriggerWarnings()
6464
{
6565
// Arrange
@@ -98,7 +98,7 @@ await Client.ExpectCircuitError(() => Client.HubConnection.SendAsync(
9898
"There is no event handler associated with this event. EventId: '1990'. (Parameter 'eventHandlerId')"));
9999
}
100100

101-
[Fact]
101+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
102102
public async Task DispatchingAnInvalidRenderAcknowledgement_DoesNotTriggerWarnings()
103103
{
104104
// Arrange

src/Components/test/E2ETest/ServerExecutionTests/HeadModificationPrerenderingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Xunit;
1010
using Xunit.Abstractions;
1111

12-
namespace Microsoft.AspNetCore.Components.E2ETests.ServerExecutionTests
12+
namespace Microsoft.AspNetCore.Components.E2ETest.ServerExecutionTests
1313
{
1414
public class HeadModificationPrerenderingTest : ServerTestBase<BasicTestAppServerSiteFixture<DeferredComponentContentStartup>>
1515
{

src/Components/test/E2ETest/ServerExecutionTests/InteropReliabilityTests.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected override async Task InitializeAsync()
3636
Assert.Equal(2, Batches.Count);
3737
}
3838

39-
[Fact]
39+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
4040
public async Task CannotInvokeNonJSInvokableMethods()
4141
{
4242
// Arrange
@@ -57,7 +57,7 @@ await Client.InvokeDotNetMethod(
5757
await ValidateClientKeepsWorking(Client, Batches);
5858
}
5959

60-
[Fact]
60+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
6161
public async Task CannotInvokeNonExistingMethods()
6262
{
6363
// Arrange
@@ -78,7 +78,7 @@ await Client.InvokeDotNetMethod(
7878
await ValidateClientKeepsWorking(Client, Batches);
7979
}
8080

81-
[Fact]
81+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
8282
public async Task CannotInvokeJSInvokableMethodsWithWrongNumberOfArguments()
8383
{
8484
// Arrange
@@ -99,7 +99,7 @@ await Client.InvokeDotNetMethod(
9999
await ValidateClientKeepsWorking(Client, Batches);
100100
}
101101

102-
[Fact]
102+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
103103
public async Task CannotInvokeJSInvokableMethodsEmptyAssemblyName()
104104
{
105105
// Arrange
@@ -120,7 +120,7 @@ await Client.InvokeDotNetMethod(
120120
await ValidateClientKeepsWorking(Client, Batches);
121121
}
122122

123-
[Fact]
123+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
124124
public async Task CannotInvokeJSInvokableMethodsEmptyMethodName()
125125
{
126126
// Arrange
@@ -142,7 +142,7 @@ await Client.InvokeDotNetMethod(
142142
await ValidateClientKeepsWorking(Client, Batches);
143143
}
144144

145-
[Fact]
145+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
146146
public async Task CannotInvokeJSInvokableMethodsWithWrongReferenceId()
147147
{
148148
// Arrange
@@ -182,7 +182,7 @@ await Client.InvokeDotNetMethod(
182182
await ValidateClientKeepsWorking(Client, Batches);
183183
}
184184

185-
[Fact]
185+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
186186
public async Task CannotInvokeJSInvokableMethodsWrongReferenceIdType()
187187
{
188188
// Arrange
@@ -213,7 +213,7 @@ await Client.InvokeDotNetMethod(
213213
await ValidateClientKeepsWorking(Client, Batches);
214214
}
215215

216-
[Fact]
216+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
217217
public async Task ContinuesWorkingAfterInvalidAsyncReturnCallback()
218218
{
219219
// Arrange
@@ -242,7 +242,7 @@ await Client.HubConnection.InvokeAsync(
242242
await ValidateClientKeepsWorking(Client, Batches);
243243
}
244244

245-
[Fact]
245+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
246246
public async Task JSInteropCompletionSuccess()
247247
{
248248
// Arrange
@@ -271,7 +271,7 @@ await Client.HubConnection.InvokeAsync(
271271
Assert.Equal(LogLevel.Debug, entry.LogLevel);
272272
}
273273

274-
[Fact]
274+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
275275
public async Task JSInteropThrowsInUserCode()
276276
{
277277
// Arrange
@@ -304,7 +304,7 @@ await Client.HubConnection.InvokeAsync(
304304
await ValidateClientKeepsWorking(Client, Batches);
305305
}
306306

307-
[Fact]
307+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
308308
public async Task MalformedJSInteropCallbackDisposesCircuit()
309309
{
310310
// Arrange
@@ -339,7 +339,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () =>
339339
});
340340
}
341341

342-
[Fact]
342+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
343343
public async Task CannotInvokeJSInvokableMethodsWithInvalidArgumentsPayload()
344344
{
345345
// Arrange
@@ -360,7 +360,7 @@ await Client.InvokeDotNetMethod(
360360
await ValidateClientKeepsWorking(Client, Batches);
361361
}
362362

363-
[Fact]
363+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
364364
public async Task CannotInvokeJSInvokableMethodsWithMalformedArgumentPayload()
365365
{
366366
// Arrange
@@ -381,7 +381,7 @@ await Client.InvokeDotNetMethod(
381381
await ValidateClientKeepsWorking(Client, Batches);
382382
}
383383

384-
[Fact]
384+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
385385
public async Task DispatchingEventsWithInvalidPayloadsShutsDownCircuitGracefully()
386386
{
387387
// Arrange
@@ -405,7 +405,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () =>
405405
});
406406
}
407407

408-
[Fact]
408+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
409409
public async Task DispatchingEventsWithInvalidEventDescriptor()
410410
{
411411
// Arrange
@@ -429,7 +429,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () =>
429429
});
430430
}
431431

432-
[Fact]
432+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
433433
public async Task DispatchingEventsWithInvalidEventArgs()
434434
{
435435
// Arrange
@@ -461,7 +461,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () =>
461461
});
462462
}
463463

464-
[Fact]
464+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
465465
public async Task DispatchingEventsWithInvalidEventHandlerId()
466466
{
467467
// Arrange
@@ -495,7 +495,7 @@ await Client.ExpectCircuitErrorAndDisconnect(async () =>
495495
});
496496
}
497497

498-
[Fact]
498+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
499499
public async Task EventHandlerThrowsSyncExceptionTerminatesTheCircuit()
500500
{
501501
// Arrange

src/Components/test/E2ETest/ServerExecutionTests/PrerenderingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void CanAccessAuthenticationStateDuringStaticPrerendering(string initialU
135135
Browser.Equal($"Hello, {interactiveUsername ?? "anonymous"}!", () => Browser.Exists(By.TagName("h1")).Text);
136136
}
137137

138-
[Fact]
138+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/35449")]
139139
public async Task NoHotReloadListenersAreOrdinarilyRegistered()
140140
{
141141
Navigate("/prerendered/prerendered-transition");

src/Components/test/E2ETest/ServerExecutionTests/RemoteRendererBufferLimitTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public RemoteRendererBufferLimitTest(BasicTestAppServerSiteFixture<ServerStartup
2222
{
2323
}
2424

25-
[Fact]
25+
[Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/19666")]
2626
public async Task DispatchedEventsWillKeepBeingProcessed_ButUpdatedWillBeDelayedUntilARenderIsAcknowledged()
2727
{
2828
// Arrange

src/Components/test/E2ETest/ServerExecutionTests/ServerInteropTestDefaultExceptionsBehavior.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public void DotNetExceptionDetailsAreNotLoggedByDefault()
6363
}
6464

6565
string GetExpectedMessage(string method) =>
66-
$"\"There was an exception invoking '{method}' on assembly 'BasicTestApp'. For more details turn on " +
67-
$"detailed exceptions in '{typeof(CircuitOptions).Name}.{nameof(CircuitOptions.DetailedErrors)}'\"";
66+
"\"There was an exception invoking '" + method + "' on assembly 'BasicTestApp'. For more details turn on " +
67+
"detailed exceptions in '" + typeof(CircuitOptions).Name + "." + nameof(CircuitOptions.DetailedErrors) + "'\"";
6868
}
6969
}
7070
}

src/Components/test/E2ETest/Tests/BindTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,9 +2022,9 @@ private void ApplyInputValue(string cssSelector, string value)
20222022
// interaction as authentically as SendKeys in other cases.
20232023
var javascript = (IJavaScriptExecutor)Browser;
20242024
javascript.ExecuteScript(
2025-
$"var elem = document.querySelector('{cssSelector}');"
2026-
+ $"elem.value = '{value}';"
2027-
+ "elem.dispatchEvent(new KeyboardEvent('change'));");
2025+
$"document.querySelector('{cssSelector}').value = '{value}'");
2026+
javascript.ExecuteScript(
2027+
$"document.querySelector('{cssSelector}').dispatchEvent(new KeyboardEvent('change'));");
20282028
}
20292029
}
20302030
}

0 commit comments

Comments
 (0)