Skip to content

Commit b7bcfdb

Browse files
authored
Enable E2ETest.ServerExecutionTests.CircuitTests (#63143)
* Close the error before the 2nd click attempt. * Apply feedback.
1 parent 0632b82 commit b7bcfdb

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ protected override void InitializeAsyncCore()
3535
[InlineData("render-throw")]
3636
[InlineData("afterrender-sync-throw")]
3737
[InlineData("afterrender-async-throw")]
38-
[QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/57588")]
3938
public void ComponentLifecycleMethodThrowsExceptionTerminatesTheCircuit(string id)
4039
{
4140
Browser.MountTestComponent<ReliabilityComponent>();
@@ -44,8 +43,7 @@ public void ComponentLifecycleMethodThrowsExceptionTerminatesTheCircuit(string i
4443
var targetButton = Browser.Exists(By.Id(id));
4544
targetButton.Click();
4645

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

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

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

7270
// Clicking it again causes the circuit to disconnect
7371
targetButton.Click();
@@ -95,4 +93,17 @@ void AssertLogContains(params string[] messages)
9593
Assert.Contains(log, entry => entry.Message.Contains(message));
9694
}
9795
}
96+
97+
void DismissBlazorErrorUI()
98+
{
99+
// Triggering an error will show the exception UI
100+
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: block;']"));
101+
102+
// Dismiss the error UI by clicking the dismiss button
103+
var dismissButton = Browser.Exists(By.CssSelector("#blazor-error-ui .dismiss"));
104+
dismissButton.Click();
105+
106+
// Wait for error UI to be hidden
107+
Browser.Exists(By.CssSelector("#blazor-error-ui[style='display: none;']"));
108+
}
98109
}

0 commit comments

Comments
 (0)