Skip to content

Commit 15b3cf2

Browse files
committed
fix for tests
1 parent 1fc5380 commit 15b3cf2

File tree

6 files changed

+35
-1
lines changed

6 files changed

+35
-1
lines changed

.github/workflows/deploy-github-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
dotnet test "$APP_TEST_PROJECT" --no-build
5252
5353
- name: Test browser suite
54-
run: dotnet test "$UI_TEST_PROJECT" --no-build
54+
run: dotnet test "$UI_TEST_PROJECT" --no-build --logger "console;verbosity=detailed"
5555

5656
prepare_release:
5757
name: Resolve Release Version

tests/PrompterOne.Web.UITests/AppShell/RuntimeTelemetryFlowTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ await WaitForTelemetryCollectionsAsync(
116116
[Fact]
117117
public async Task RuntimeTelemetry_DoesNotTrack_WhenWasmDebugQueryIsEnabled()
118118
{
119+
await _fixture.ResetRuntimeAsync();
119120
var page = await _fixture.NewPageAsync();
120121

121122
try

tests/PrompterOne.Web.UITests/Editor/EditorAiScrollStabilityTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public sealed class EditorAiScrollStabilityTests(StandaloneAppFixture fixture) :
1212
[Fact]
1313
public async Task EditorScreen_AiAction_DoesNotJumpScrollPositionForVisibleSelection()
1414
{
15+
await _fixture.ResetRuntimeAsync();
1516
var page = await _fixture.NewPageAsync();
1617

1718
try

tests/PrompterOne.Web.UITests/Editor/EditorHugeDraftPerformanceTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public sealed class EditorHugeDraftPerformanceTests(StandaloneAppFixture fixture
1010
[Fact]
1111
public async Task EditorScreen_HugeDraftLoadedFromSeedKeepsFollowupTypingResponsive()
1212
{
13+
await _fixture.ResetRuntimeAsync();
1314
var page = await _fixture.NewPageAsync();
1415

1516
try

tests/PrompterOne.Web.UITests/Editor/EditorLargeDraftPerformanceTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public sealed class EditorLargeDraftPerformanceTests(StandaloneAppFixture fixtur
1111
[Fact]
1212
public async Task EditorScreen_LargeDraftPasteKeepsFollowupTypingResponsive()
1313
{
14+
await _fixture.ResetRuntimeAsync();
1415
var page = await _fixture.NewPageAsync();
1516

1617
try

tests/PrompterOne.Web.UITests/Infrastructure/StandaloneAppFixture.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ public async Task DisposeAsync()
4242
}
4343
}
4444

45+
public async Task ResetRuntimeAsync()
46+
{
47+
while (_contexts.TryTake(out var context))
48+
{
49+
try
50+
{
51+
await context.DisposeAsync();
52+
}
53+
catch
54+
{
55+
}
56+
}
57+
58+
_runtimeHandle = null;
59+
await SharedRuntime.ResetAsync();
60+
}
61+
4562
public async Task<IPage> NewPageAsync()
4663
{
4764
var context = await NewContextAsync();
@@ -180,6 +197,19 @@ public static async Task<SharedRuntimeHandle> AcquireAsync()
180197

181198
public static Task ReleaseAsync() => Task.CompletedTask;
182199

200+
public static async Task ResetAsync()
201+
{
202+
await LifecycleGate.WaitAsync();
203+
try
204+
{
205+
await DisposeRuntimeAsync();
206+
}
207+
finally
208+
{
209+
LifecycleGate.Release();
210+
}
211+
}
212+
183213
private static async Task StartRuntimeAsync()
184214
{
185215
_server = CreateServer();

0 commit comments

Comments
 (0)