Skip to content

Enable E2ETest.ServerExecutionTests.CircuitTests #63143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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