Skip to content
Merged
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
21 changes: 16 additions & 5 deletions src/Components/test/E2ETest/Tests/CircuitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ protected override void InitializeAsyncCore()
[InlineData("render-throw")]
[InlineData("afterrender-sync-throw")]
[InlineData("afterrender-async-throw")]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57588")]
public void ComponentLifecycleMethodThrowsExceptionTerminatesTheCircuit(string id)
{
Browser.MountTestComponent<ReliabilityComponent>();
Expand All @@ -44,8 +43,7 @@ public void ComponentLifecycleMethodThrowsExceptionTerminatesTheCircuit(string i
var targetButton = Browser.Exists(By.Id(id));
targetButton.Click();

// Triggering an error will show the exception UI
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"));
DismissBlazorErrorUI();

// Clicking the button again will trigger a server disconnect
targetButton.Click();
Expand All @@ -54,7 +52,6 @@ public void ComponentLifecycleMethodThrowsExceptionTerminatesTheCircuit(string i
}

[Fact]
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57588")]
public void ComponentDisposeMethodThrowsExceptionTerminatesTheCircuit()
{
Browser.MountTestComponent<ReliabilityComponent>();
Expand All @@ -67,7 +64,8 @@ public void ComponentDisposeMethodThrowsExceptionTerminatesTheCircuit()
targetButton.Click();
// Clicking it again hides the component and invokes the rethrow which triggers the exception
targetButton.Click();
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"));

DismissBlazorErrorUI();

// Clicking it again causes the circuit to disconnect
targetButton.Click();
Expand Down Expand Up @@ -95,4 +93,17 @@ void AssertLogContains(params string[] messages)
Assert.Contains(log, entry => entry.Message.Contains(message));
}
}

void DismissBlazorErrorUI()
{
// Triggering an error will show the exception UI
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"));

// Dismiss the error UI by clicking the dismiss button
var dismissButton = Browser.Exists(By.CssSelector("#blazor-error-ui .dismiss"));
dismissButton.Click();

// Wait for error UI to be hidden
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: none;']"));
}
}
Loading