diff --git a/BTCPayServer.Tests/PlaywrightTester.cs b/BTCPayServer.Tests/PlaywrightTester.cs index 1c6501e42..1d84ed129 100644 --- a/BTCPayServer.Tests/PlaywrightTester.cs +++ b/BTCPayServer.Tests/PlaywrightTester.cs @@ -566,21 +566,11 @@ namespace BTCPayServer.Tests } await Page.ClickAsync("#FakePayment"); await Page.Locator("#CheatSuccessMessage").WaitForAsync(); - // TODO: Fix flakyness - try - { - await Page.Locator("text=Payment Received").WaitForAsync(); - } - catch - { - await TakeScreenshot("PayInvoice.png"); - throw; - } - if (mine) { await MineBlockOnInvoiceCheckout(); } + await Page.Locator("xpath=//*[text()=\"Invoice Paid\" or text()=\"Payment Received\"]").WaitForAsync(); } /// diff --git a/BTCPayServer.Tests/WalletTests.cs b/BTCPayServer.Tests/WalletTests.cs index b9764dcc3..eaee1ccc7 100644 --- a/BTCPayServer.Tests/WalletTests.cs +++ b/BTCPayServer.Tests/WalletTests.cs @@ -74,6 +74,7 @@ public class WalletTests(ITestOutputHelper helper) : UnitTestBase(helper) await s.ClickPagePrimary(); await s.Page.ClickAsync("#BroadcastTransaction"); + await s.FindAlertMessage(); await s.Page.ReloadAsync(); var rbfTx = (await client.ShowOnChainWalletTransactions(s.StoreId, "BTC")).Select(t => t.TransactionHash).ToArray()[0]; @@ -82,17 +83,7 @@ public class WalletTests(ITestOutputHelper helper) : UnitTestBase(helper) await w.AssertNotFound(cpfpTx); // However, the new transaction should have copied the CPFP tag from the transaction it replaced, and have a RBF label as well. - try - { - await w.AssertHasLabels(rbfTx, "CPFP"); - } - catch - { - // TODO: Flaky - await s.TakeScreenshot("AssertHasLabels-Fails.png"); - throw; - } - + await w.AssertHasLabels(rbfTx, "CPFP"); await w.AssertHasLabels(rbfTx, "RBF"); // Now, we sweep all the UTXOs to a single destination. This should be RBF-able. (Fee deducted on the lone UTXO) diff --git a/BTCPayServer/EventAggregator.cs b/BTCPayServer/EventAggregator.cs index e589a83eb..924b8f912 100644 --- a/BTCPayServer/EventAggregator.cs +++ b/BTCPayServer/EventAggregator.cs @@ -88,7 +88,7 @@ namespace BTCPayServer } if (Logs.Events.IsEnabled(LogLevel.Information)) - Logs.Events.LogInformation("Event published {0}", evt); + Logs.Events.LogInformation("Event published {0}", string.IsNullOrEmpty(evt?.ToString()) ? evtType.GetType().Name : evt.ToString()); foreach (var sub in actionList) { diff --git a/BTCPayServer/HostedServices/Webhooks/InvoiceWebhookDeliveryRequest.cs b/BTCPayServer/HostedServices/Webhooks/InvoiceWebhookDeliveryRequest.cs index 1413ae141..09170bb6c 100644 --- a/BTCPayServer/HostedServices/Webhooks/InvoiceWebhookDeliveryRequest.cs +++ b/BTCPayServer/HostedServices/Webhooks/InvoiceWebhookDeliveryRequest.cs @@ -47,4 +47,7 @@ public class InvoiceWebhookDeliveryRequest( res = InterpolateJsonField(res, "Invoice.Metadata", Invoice.Metadata.ToJObject()); return res; } + + public override string ToString() + => $"Webhook delivery request ({webhookEvent.Type})"; }