Replace non-waiting Assert.True(await locator.IsVisibleAsync()) checks with
auto-retrying Assertions.Expect(locator).ToBeVisibleAsync()/ToBeHiddenAsync()
to remove flakiness against Blazor's async rendering. Table-row/field page
objects (Metadata/Roles/Users/Profile) now expose ILocator helpers instead of
Task<bool>, so deletion checks wait for the element to disappear.
Also: rename ScreenshotHelper.CaptureIfFailedAsync to CaptureAsync (xUnit v2
cannot expose the test outcome to DisposeAsync, so it always captures the final
page state), drop the unused TestConstants.ServerPort/BaseUrl now that ports
bind dynamically, and fix IClassFixture doc comments to ICollectionFixture.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ScreenshotHelper that captures full-page screenshots for every test
- Screenshots are named with the full test display name for easy correlation
- Save to SCREENSHOT_DIR env var (CI) or bin/Screenshots/ (local)
- Add ITestOutputHelper to all 10 test classes for test name extraction
- Screenshots are included in the existing ui-test-results artifact upload
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Refactor FirstTimeSetupTests to use FreshServerFixture via ICollectionFixture
instead of creating its own UITestApplicationFactory per test
- Skip _realHost.Dispose() in UITestApplicationFactory since the DI container's
deep dependency chain causes an uncatchable native StackOverflowException
- All 62 tests pass with exit code 0 (61 pass, 1 skip)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Switch all test classes from IClassFixture<ConfiguredServerFixture> to
[Collection("Server")] with ICollectionFixture so a single server instance
is shared across all test classes (avoids static DatabaseContext.Provider conflicts)
- Put FirstTimeSetupTests in its own collection since it needs an unconfigured server
- Remove Hangfire hosted services in UITestApplicationFactory to prevent
stack overflow during process shutdown (deep DI disposal chain)
- Add graceful shutdown handling with timeout in DisposeAsync
- All 54 tests pass, 1 skipped, clean exit code 0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace process-based server management (ServerManager) with ASP.NET Core's
WebApplicationFactory<Program> for proper integration testing:
- Add UITestApplicationFactory with dual-host pattern (real Kestrel + dummy TestServer)
to work around .NET 9's hard-cast to TestServer in WebApplicationFactory
- Use in-memory EF Core database with dynamic port binding (IPAddress.Loopback:0)
- Stub IVersionProvider and IGitHubService to avoid external dependencies
- Programmatically create admin user in ConfiguredServerFixture via service layer
- Remove ServerManager.cs (no longer needed)
- Skip CompleteWizardAndLogin test (requires real DB file I/O)
- 18 tests pass, 1 skipped, ~28s runtime (down from ~101s)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>