From 5df76b9c00a07d1f0b86d2465fd3d7cd7f24268d Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 23 Apr 2025 16:38:49 +0900 Subject: [PATCH] Make test less flaky --- BTCPayServer.Tests/PlaywrightTests.cs | 4 +++- BTCPayServer/Controllers/UIStoresController.Email.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Tests/PlaywrightTests.cs b/BTCPayServer.Tests/PlaywrightTests.cs index cc2902ea3..e833aa0e9 100644 --- a/BTCPayServer.Tests/PlaywrightTests.cs +++ b/BTCPayServer.Tests/PlaywrightTests.cs @@ -491,14 +491,16 @@ namespace BTCPayServer.Tests await s.Page.Locator("#Settings_From").ClearAsync(); await s.Page.Locator("#Settings_From").FillAsync("Firstname Lastname "); await s.ClickPagePrimary(); + await s.FindAlertMessage(partialText: "Email settings saved"); Assert.Contains("Configured", await s.Page.ContentAsync()); await s.Page.Locator("#Settings_Login").ClearAsync(); await s.Page.Locator("#Settings_Login").FillAsync("test_fix@gmail.com"); await s.ClickPagePrimary(); + await s.FindAlertMessage(partialText: "Email settings saved"); Assert.Contains("Configured", await s.Page.ContentAsync()); Assert.Contains("test_fix", await s.Page.ContentAsync()); await s.Page.Locator("#ResetPassword").PressAsync("Enter"); - await s.FindAlertMessage(); + await s.FindAlertMessage(partialText: "Email server password reset"); Assert.DoesNotContain("Configured", await s.Page.ContentAsync()); Assert.Contains("test_fix", await s.Page.ContentAsync()); } diff --git a/BTCPayServer/Controllers/UIStoresController.Email.cs b/BTCPayServer/Controllers/UIStoresController.Email.cs index 75ad21ceb..1f9d1267d 100644 --- a/BTCPayServer/Controllers/UIStoresController.Email.cs +++ b/BTCPayServer/Controllers/UIStoresController.Email.cs @@ -115,7 +115,7 @@ public partial class UIStoresController storeBlob.EmailSettings = model.Settings; store.SetStoreBlob(storeBlob); await _storeRepo.UpdateStore(store); - TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["Email settings modified"].Value; + TempData[WellKnownTempData.SuccessMessage] = StringLocalizer["Email settings saved"].Value; } return RedirectToAction(nameof(StoreEmailSettings), new { storeId }); }