What changed, and why it matters
This commit fixes a flaky automated test, not a security issue. The test previously checked the entire web page content for an email address, which could fail if the email appeared anywhere else on the page or if timing caused the page content to be incomplete. The change narrows the check to look specifically at the value of the email input field. There is no indication this affects real users or production code.
No security action needed. This is a routine test maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In BTCPayServer.Tests/PlaywrightTests.cs, the CanUseForms test assertion was changed from Assert.Contains(“aa@aa.com”, await s.Page.ContentAsync()) to await Expect(s.Page.Locator(“#Email”)).ToHaveValueAsync(“aa@aa.com”). This is a test reliability improvement: it scopes the assertion to the #Email form field value rather than the full page HTML. No production code is modified.
Changed components
BTCPayServer.Tests/PlaywrightTests.csInspect captured patch +2 / −1
diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs
index e7fed90..617450b 100644
--- a/BTCPayServer.Tests/PlaywrightTests.cs
+++ b/BTCPayServer.Tests/PlaywrightTests.cs
@@ -111,7 +111,8 @@ namespace BTCPayServer.Tests
await popOutPage.CloseAsync();
await s.Page.Context.Pages.First().BringToFrontAsync();
await s.GoToUrl(editUrl.PathAndQuery);
- Assert.Contains("aa@aa.com", await s.Page.ContentAsync());
+
+ await Expect(s.Page.Locator("#Email")).ToHaveValueAsync("aa@aa.com");
var invoice = await s.Server.PayTester.GetService<InvoiceRepository>().GetInvoice(invoiceId);
Assert.Equal("aa@aa.com", invoice.Metadata.BuyerEmail);
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.