What changed, and why it matters
This commit only changes test code. It replaces a few brittle checks in automated UI tests with more robust Playwright-style assertions and adds a page-load wait. There is no change to production code, no user-facing behavior change, and no security relevance.
No security action needed. Treat as routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies BTCPayServer.Tests/PlaywrightTests.cs. It swaps three Assert.Contains calls against raw page HTML for explicit Playwright locators/expectations (ToBeVisibleAsync, FindAlertMessage, ToContainTextAsync) and adds a DOMContentLoaded wait before a delete-flow assertion. These are test-stability improvements only; no application code is touched.
Changed components
BTCPayServer.Tests/PlaywrightTests.csInspect captured patch +4 / −3
diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs
index a5c226a..75d92f4 100644
--- a/BTCPayServer.Tests/PlaywrightTests.cs
+++ b/BTCPayServer.Tests/PlaywrightTests.cs
@@ -1616,7 +1616,7 @@ namespace BTCPayServer.Tests
await s.StartAsync();
await s.RegisterNewUser(isAdmin: true);
await s.GoToUrl("/server/services");
- Assert.Contains("Dynamic DNS", await s.Page.ContentAsync());
+ await Expect(s.Page.Locator("td").Filter(new() { HasText = "Dynamic DNS" })).ToBeVisibleAsync();
await s.GoToUrl("/server/services/dynamic-dns");
await s.Page.AssertNoError();
@@ -1634,7 +1634,7 @@ namespace BTCPayServer.Tests
await s.Page.FillAsync("#Settings_Password", "MyLog");
await s.ClickPagePrimary();
await s.Page.AssertNoError();
- Assert.Contains("The Dynamic DNS has been successfully queried", await s.Page.ContentAsync());
+ await s.FindAlertMessage(partialText: "The Dynamic DNS has been successfully queried");
Assert.EndsWith("/server/services/dynamic-dns", s.Page.Url);
// Try to create the same hostname (should fail)
@@ -1646,10 +1646,11 @@ namespace BTCPayServer.Tests
await s.Page.FillAsync("#Settings_Password", "MyLog");
await s.ClickPagePrimary();
await s.Page.AssertNoError();
- Assert.Contains("This hostname already exists", await s.Page.ContentAsync());
+ await Expect(s.Page.Locator(".validation-summary-errors")).ToContainTextAsync("This hostname already exists");
// Delete the hostname
await s.GoToUrl("/server/services/dynamic-dns");
+ await s.Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
Assert.Contains("/server/services/dynamic-dns/pouet.hello.com/delete", await s.Page.ContentAsync());
await s.GoToUrl("/server/services/dynamic-dns/pouet.hello.com/delete");
await s.Page.ClickAsync("#ConfirmContinue");
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.