What changed, and why it matters
This commit changes two lines in a single test file to make a flaky test more reliable. It replaces a broad check that the page contains the text 'Pay123' with a more precise check that a specific element with the expected ID shows the text 'Pay123'. This is a test-quality improvement, not a security fix.
No security action needed. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In BTCPayServer.Tests/PlaywrightTests.cs, two assertions using Assert.Contains on the full page content are replaced with Playwright’s Expect().ToHaveTextAsync() against a specific locator (#Edit-{payReqId}). This narrows the assertion to the intended payment request row, reducing false negatives/positives caused by unrelated page content. No application code is modified.
Changed components
BTCPayServer.Tests/PlaywrightTests.csInspect captured patch +2 / −2
diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs
index 75d92f4..9c57dd1 100644
--- a/BTCPayServer.Tests/PlaywrightTests.cs
+++ b/BTCPayServer.Tests/PlaywrightTests.cs
@@ -257,13 +257,13 @@ namespace BTCPayServer.Tests
Assert.DoesNotContain("Pay123", await s.Page.ContentAsync());
await s.Page.ClickAsync("#StatusOptionsToggle");
await s.Page.ClickAsync("#StatusOptionsIncludeArchived");
- Assert.Contains("Pay123", await s.Page.ContentAsync());
+ await Expect(s.Page.Locator($"#Edit-{payReqId}")).ToHaveTextAsync("Pay123");
// unarchive (from list)
await s.Page.ClickAsync($"#ToggleActions-{payReqId}");
await s.Page.ClickAsync($"#ToggleArchival-{payReqId}");
await s.FindAlertMessage(partialText: "The payment request has been unarchived");
- Assert.Contains("Pay123", await s.Page.ContentAsync());
+ await Expect(s.Page.Locator($"#Edit-{payReqId}")).ToHaveTextAsync("Pay123");
// payment
await s.GoToUrl(viewUrl);
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.