diff --git a/BTCPayServer.Tests/ApiKeysTests.cs b/BTCPayServer.Tests/ApiKeysTests.cs index 606768d5d..a29dd9d7f 100644 --- a/BTCPayServer.Tests/ApiKeysTests.cs +++ b/BTCPayServer.Tests/ApiKeysTests.cs @@ -47,7 +47,7 @@ namespace BTCPayServer.Tests s.GoToLogin(); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.GoToProfile(ManageNavPages.APIKeys); - s.Driver.FindElement(By.Id("AddApiKey")).Click(); + s.ClickPagePrimary(); //not an admin, so this permission should not show Assert.DoesNotContain("btcpay.server.canmodifyserversettings", s.Driver.PageSource); @@ -56,34 +56,34 @@ namespace BTCPayServer.Tests s.GoToLogin(); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.GoToProfile(ManageNavPages.APIKeys); - s.Driver.FindElement(By.Id("AddApiKey")).Click(); + s.ClickPagePrimary(); Assert.Contains("btcpay.server.canmodifyserversettings", s.Driver.PageSource); //server management should show now s.Driver.SetCheckbox(By.Id("btcpay.server.canmodifyserversettings"), true); s.Driver.SetCheckbox(By.Id("btcpay.store.canmodifystoresettings"), true); s.Driver.SetCheckbox(By.Id("btcpay.user.canviewprofile"), true); - s.Driver.FindElement(By.Id("Generate")).Click(); + s.ClickPagePrimary(); var superApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; //this api key has access to everything await TestApiAgainstAccessToken(superApiKey, tester, user, Policies.CanModifyServerSettings, Policies.CanModifyStoreSettings, Policies.CanViewProfile); - s.Driver.FindElement(By.Id("AddApiKey")).Click(); + s.ClickPagePrimary(); s.Driver.SetCheckbox(By.Id("btcpay.server.canmodifyserversettings"), true); - s.Driver.FindElement(By.Id("Generate")).Click(); + s.ClickPagePrimary(); var serverOnlyApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; await TestApiAgainstAccessToken(serverOnlyApiKey, tester, user, Policies.CanModifyServerSettings); - s.Driver.FindElement(By.Id("AddApiKey")).Click(); + s.ClickPagePrimary(); s.Driver.SetCheckbox(By.Id("btcpay.store.canmodifystoresettings"), true); - s.Driver.FindElement(By.Id("Generate")).Click(); + s.ClickPagePrimary(); var allStoreOnlyApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; await TestApiAgainstAccessToken(allStoreOnlyApiKey, tester, user, Policies.CanModifyStoreSettings); - s.Driver.FindElement(By.Id("AddApiKey")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.CssSelector("button[value='btcpay.store.canmodifystoresettings:change-store-mode']")).Click(); //there should be a store already by default in the dropdown var getPermissionValueIndex = @@ -94,13 +94,13 @@ namespace BTCPayServer.Tests var option = dropdown.FindElement(By.TagName("option")); var storeId = option.GetAttribute("value"); option.Click(); - s.Driver.WaitForAndClick(By.Id("Generate")); + s.ClickPagePrimary(); var selectiveStoreApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; await TestApiAgainstAccessToken(selectiveStoreApiKey, tester, user, Permission.Create(Policies.CanModifyStoreSettings, storeId).ToString()); - s.Driver.WaitForAndClick(By.Id("AddApiKey")); - s.Driver.WaitForAndClick(By.Id("Generate")); + s.ClickPagePrimary(); // New API key + s.ClickPagePrimary(); // Generate var noPermissionsApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; await TestApiAgainstAccessToken(noPermissionsApiKey, tester, user); await Assert.ThrowsAnyAsync(async () => @@ -223,12 +223,12 @@ namespace BTCPayServer.Tests s.GoToLogin(); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.GoToUrl("/account/apikeys"); - s.Driver.WaitForAndClick(By.Id("AddApiKey")); + s.ClickPagePrimary(); int checkedPermissionCount = s.Driver.FindElements(By.ClassName("form-check-input")).Count; s.Driver.ExecuteJavaScript("document.querySelectorAll('#Permissions .form-check-input').forEach(i => i.click())"); TestLogs.LogInformation("Generating API key"); - s.Driver.WaitForAndClick(By.Id("Generate")); + s.ClickPagePrimary(); var allAPIKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; TestLogs.LogInformation($"Checking API key permissions: {allAPIKey}"); diff --git a/BTCPayServer.Tests/CheckoutUITests.cs b/BTCPayServer.Tests/CheckoutUITests.cs index 047e30436..3d813d1dd 100644 --- a/BTCPayServer.Tests/CheckoutUITests.cs +++ b/BTCPayServer.Tests/CheckoutUITests.cs @@ -38,7 +38,7 @@ namespace BTCPayServer.Tests var supportUrl = "https://support.satoshisteaks.com/{InvoiceId}/"; s.GoToStore(); s.Driver.FindElement(By.Id("StoreWebsite")).SendKeys(storeUrl); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); s.GoToStore(StoreNavPages.CheckoutAppearance); @@ -46,7 +46,7 @@ namespace BTCPayServer.Tests s.Driver.WaitForAndClick(By.Id("Presets_InStore")); Assert.True(s.Driver.SetCheckbox(By.Id("ShowPayInWalletButton"), true)); s.Driver.FindElement(By.Id("SupportUrl")).SendKeys(supportUrl); - s.Driver.FindElement(By.Id("Save")).SendKeys(Keys.Enter); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); // Top up/zero amount invoices @@ -105,7 +105,7 @@ namespace BTCPayServer.Tests s.GoToHome(); s.GoToLightningSettings(); s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), true); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text); s.GoToInvoiceCheckout(invoiceId); Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text); @@ -251,7 +251,7 @@ namespace BTCPayServer.Tests s.GoToStore(StoreNavPages.CheckoutAppearance); s.Driver.SetCheckbox(By.Id("OnChainWithLnInvoiceFallback"), true); s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), false); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); invoiceId = s.CreateInvoice(); @@ -285,7 +285,7 @@ namespace BTCPayServer.Tests s.GoToHome(); s.GoToStore(StoreNavPages.CheckoutAppearance); s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), true); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); s.GoToInvoiceCheckout(invoiceId); Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text); @@ -368,7 +368,7 @@ namespace BTCPayServer.Tests Assert.Equal("5", displayExpirationTimer.GetAttribute("value")); displayExpirationTimer.Clear(); displayExpirationTimer.SendKeys("10"); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); s.GoToInvoiceCheckout(invoiceId); @@ -392,8 +392,7 @@ namespace BTCPayServer.Tests s.GoToHome(); s.GoToLightningSettings(); s.Driver.SetCheckbox(By.Id("LNURLEnabled"), false); - s.Driver.ScrollTo(By.Id("save")); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text); // Test: diff --git a/BTCPayServer.Tests/LanguageServiceTests.cs b/BTCPayServer.Tests/LanguageServiceTests.cs index d94a7271b..785725e45 100644 --- a/BTCPayServer.Tests/LanguageServiceTests.cs +++ b/BTCPayServer.Tests/LanguageServiceTests.cs @@ -46,15 +46,15 @@ namespace BTCPayServer.Tests // Create English (Custom) tester.LogIn(); tester.GoToServer(Views.Server.ServerNavPages.Translations); - tester.Driver.FindElement(By.Id("CreateDictionary")).Click(); + tester.ClickPagePrimary(); tester.Driver.FindElement(By.Name("Name")).SendKeys("English (Custom)"); - tester.Driver.FindElement(By.Id("Create")).Click(); + tester.ClickPagePrimary(); var translations = tester.Driver.FindElement(By.Name("Translations")); var text = translations.Text; text = text.Replace("Password => Password", "Password => Mot de passe"); translations.Clear(); translations.SendKeys("Password => Mot de passe"); - tester.Driver.FindElement(By.Id("SaveButton")).Click(); + tester.ClickPagePrimary(); // Check English (Custom) can be selected tester.Driver.FindElement(By.Id("Select-English (Custom)")).Click(); diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index f626356cf..e2f51b29d 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -325,14 +325,14 @@ retry: } } - Driver.FindElement(By.Id("save")).Click(); + ClickPagePrimary(); Assert.Contains($"{cryptoCode} Lightning node updated.", FindAlertMessage().Text); var enabled = Driver.FindElement(By.Id($"{cryptoCode}LightningEnabled")); if (enabled.Selected == false) { enabled.Click(); - Driver.FindElement(By.Id("save")).Click(); + ClickPagePrimary(); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", FindAlertMessage().Text); } } @@ -517,7 +517,7 @@ retry: { GoToInvoices(storeId); - Driver.FindElement(By.Id("CreateNewInvoice")).Click(); + ClickPagePrimary(); if (amount is decimal v) Driver.FindElement(By.Id("Amount")).SendKeys(v.ToString(CultureInfo.InvariantCulture)); var currencyEl = Driver.FindElement(By.Id("Currency")); @@ -526,7 +526,7 @@ retry: Driver.FindElement(By.Id("BuyerEmail")).SendKeys(refundEmail); if (defaultPaymentMethod is not null) new SelectElement(Driver.FindElement(By.Name("DefaultPaymentMethod"))).SelectByValue(defaultPaymentMethod); - Driver.FindElement(By.Id("Create")).Click(); + ClickPagePrimary(); var statusElement = FindAlertMessage(expectedSeverity); var inv = expectedSeverity == StatusMessageModel.StatusSeverity.Success ? statusElement.Text.Split(" ")[1] : null; @@ -643,10 +643,22 @@ retry: name = $"{type}-{Guid.NewGuid().ToString()[..14]}"; Driver.FindElement(By.Id($"StoreNav-Create{type}")).Click(); Driver.FindElement(By.Name("AppName")).SendKeys(name); - Driver.FindElement(By.Id("Create")).Click(); + ClickPagePrimary(); Assert.Contains("App successfully created", FindAlertMessage().Text); var appId = Driver.Url.Split('/')[4]; return (name, appId); } + + public void ClickPagePrimary() + { + try + { + Driver.FindElement(By.Id("page-primary")).Click(); + } + catch (NoSuchElementException) + { + Driver.WaitForAndClick(By.Id("page-primary")); + } + } } } diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 8673364aa..65419ce2f 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -84,11 +84,11 @@ namespace BTCPayServer.Tests var appName = $"PoS-{Guid.NewGuid().ToString()[..21]}"; s.Driver.FindElement(By.Id("StoreNav-CreatePointOfSale")).Click(); s.Driver.FindElement(By.Id("AppName")).SendKeys(appName); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); Assert.Contains("App successfully created", s.FindAlertMessage().Text); new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("ViewApp")).Click(); @@ -110,12 +110,13 @@ namespace BTCPayServer.Tests // Payment Request s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); - s.Driver.FindElement(By.Id("CreatePaymentRequest")).Click(); + s.ClickPagePrimary(); Thread.Sleep(10000); s.Driver.FindElement(By.Id("Title")).SendKeys("Pay123"); s.Driver.FindElement(By.Id("Amount")).SendKeys("700"); new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.Driver.TakeScreenshot().SaveAsFile("C:\\Users\\NicolasDorier\\Downloads\\chromedriver-win64\\1.png"); + s.ClickPagePrimary(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click(); var editUrl = s.Driver.Url; @@ -127,7 +128,7 @@ namespace BTCPayServer.Tests Assert.Contains("Enter your email", s.Driver.PageSource); s.Driver.FindElement(By.Name("buyerEmail")).SendKeys("aa@aa.com"); - s.Driver.FindElement(By.CssSelector("input[type='submit']")).Click(); + s.ClickPagePrimary(); invoiceId = s.Driver.Url.Split('/').Last(); s.Driver.Close(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.First()); @@ -140,7 +141,7 @@ namespace BTCPayServer.Tests //Custom Forms s.GoToStore(StoreNavPages.Forms); Assert.Contains("There are no forms yet.", s.Driver.PageSource); - s.Driver.FindElement(By.Id("CreateForm")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Name("Name")).SendKeys("Custom Form 1"); s.Driver.FindElement(By.Id("ApplyEmailTemplate")).Click(); @@ -153,7 +154,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Name("FormConfig")).Clear(); s.Driver.FindElement(By.Name("FormConfig")) .SendKeys(config.Replace("Enter your email", "CustomFormInputTest")); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Id("ViewForm")).Click(); var formurl = s.Driver.Url; @@ -172,7 +173,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("ConfirmContinue")).Click(); Assert.DoesNotContain("Custom Form 1", s.Driver.PageSource); - s.Driver.FindElement(By.Id("CreateForm")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Name("Name")).SendKeys("Custom Form 2"); s.Driver.FindElement(By.Id("ApplyEmailTemplate")).Click(); @@ -184,7 +185,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Name("FormConfig")).Clear(); s.Driver.FindElement(By.Name("FormConfig")) .SendKeys(config.Replace("Enter your email", "CustomFormInputTest2")); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Id("ViewForm")).Click(); formurl = s.Driver.Url; result = await s.Server.PayTester.HttpClient.GetAsync(formurl); @@ -198,12 +199,12 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Name("Name")).Clear(); s.Driver.FindElement(By.Name("Name")).SendKeys("Custom Form 3"); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.GoToStore(StoreNavPages.Forms); Assert.Contains("Custom Form 3", s.Driver.PageSource); s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); - s.Driver.FindElement(By.Id("CreatePaymentRequest")).Click(); + s.ClickPagePrimary(); Assert.Equal(4, new SelectElement(s.Driver.FindElement(By.Id("FormId"))).Options.Count); } @@ -296,7 +297,7 @@ namespace BTCPayServer.Tests s.GoToProfile(); s.Driver.FindElement(By.Id("Email")).Clear(); s.Driver.FindElement(By.Id("Email")).SendKeys(u2.RegisterDetails.Email); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains("The email address is already in use with an other account.", s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error).Text); @@ -305,7 +306,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Email")).Clear(); var changedEmail = Guid.NewGuid() + "@lol.com"; s.Driver.FindElement(By.Id("Email")).SendKeys(changedEmail); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); var manager = tester.PayTester.GetService>(); @@ -348,7 +349,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("OldPassword")).SendKeys("123456"); s.Driver.FindElement(By.Id("NewPassword")).SendKeys(newPassword); s.Driver.FindElement(By.Id("ConfirmPassword")).SendKeys(newPassword); - s.Driver.FindElement(By.Id("UpdatePassword")).Click(); + s.ClickPagePrimary(); s.Logout(); s.Driver.AssertNoError(); @@ -367,11 +368,11 @@ namespace BTCPayServer.Tests s.RegisterNewUser(true); s.GoToHome(); s.GoToServer(ServerNavPages.Users); - s.Driver.FindElement(By.Id("CreateUser")).Click(); + s.ClickPagePrimary(); var usr = RandomUtils.GetUInt256().ToString().Substring(64 - 20) + "@a.com"; s.Driver.FindElement(By.Id("Email")).SendKeys(usr); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); var url = s.FindAlertMessage().FindElement(By.TagName("a")).Text; s.Logout(); @@ -383,7 +384,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Password")).SendKeys("123456"); s.Driver.FindElement(By.Id("ConfirmPassword")).SendKeys("123456"); - s.Driver.FindElement(By.Id("SetPassword")).Click(); + s.ClickPagePrimary(); Assert.Contains("Account successfully created.", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("Email")).SendKeys(usr); @@ -422,7 +423,7 @@ namespace BTCPayServer.Tests Assert.True(s.Driver.FindElement(By.Id("EnableRegistration")).Selected); Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); s.Driver.FindElement(By.Id("RequiresUserApproval")).Click(); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); Assert.Contains("Policies updated successfully", s.FindAlertMessage().Text); Assert.True(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); @@ -458,13 +459,13 @@ namespace BTCPayServer.Tests Assert.True(s.Driver.FindElement(By.Id("EnableRegistration")).Selected); Assert.True(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); s.Driver.FindElement(By.Id("RequiresUserApproval")).Click(); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); Assert.Contains("Policies updated successfully", s.FindAlertMessage().Text); Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); // Check user create view does not have approval checkbox s.GoToServer(ServerNavPages.Users); - s.Driver.FindElement(By.Id("CreateUser")).Click(); + s.ClickPagePrimary(); s.Driver.ElementDoesNotExist(By.Id("Approved")); s.Logout(); @@ -521,7 +522,7 @@ namespace BTCPayServer.Tests // Approve user s.Driver.FindElement(By.CssSelector("#UsersList tr.user-overview-row:first-child .user-edit")).Click(); s.Driver.FindElement(By.Id("Approved")).Click(); - s.Driver.FindElement(By.Id("SaveUser")).Click(); + s.ClickPagePrimary(); Assert.Contains("User successfully updated", s.FindAlertMessage().Text); // Check list again s.GoToServer(ServerNavPages.Users); @@ -614,7 +615,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Settings_Login")).Clear(); s.Driver.FindElement(By.Id("Settings_Password")).Clear(); s.Driver.FindElement(By.Id("Settings_From")).Clear(); - s.Driver.FindElement(By.Id("Save")).Submit(); + s.ClickPagePrimary(); // Store Emails without server fallback s.GoToStore(StoreNavPages.Emails); @@ -680,7 +681,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("ConfirmContinue")).Click(); } - s.Driver.FindElement(By.Id("AddDynamicDNS")).Click(); + s.ClickPagePrimary(); s.Driver.AssertNoError(); // We will just cheat for test purposes by only querying the server s.Driver.FindElement(By.Id("ServiceUrl")).SendKeys(s.Link("/")); @@ -692,7 +693,7 @@ namespace BTCPayServer.Tests Assert.EndsWith("/server/services/dynamic-dns", s.Driver.Url); // Try to do the same thing should fail (hostname already exists) - s.Driver.FindElement(By.Id("AddDynamicDNS")).Click(); + s.ClickPagePrimary(); s.Driver.AssertNoError(); s.Driver.FindElement(By.Id("ServiceUrl")).SendKeys(s.Link("/")); s.Driver.FindElement(By.Id("Settings_Hostname")).SendKeys("pouet.hello.com"); @@ -721,7 +722,7 @@ namespace BTCPayServer.Tests s.GoToInvoices(); // Should give us an error message if we try to create an invoice before adding a wallet - s.Driver.FindElement(By.Id("CreateNewInvoice")).Click(); + s.ClickPagePrimary(); Assert.Contains("To create an invoice, you need to", s.Driver.PageSource); s.AddDerivationScheme(); @@ -955,18 +956,18 @@ namespace BTCPayServer.Tests s.GoToStore(); Assert.False(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected); s.Driver.SetCheckbox(By.Id("AnyoneCanCreateInvoice"), true); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); Assert.True(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected); // Store settings: Set and unset brand color s.GoToStore(); s.Driver.FindElement(By.Id("BrandColor")).SendKeys("#f7931a"); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); Assert.Equal("#f7931a", s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value")); s.Driver.FindElement(By.Id("BrandColor")).Clear(); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); Assert.Equal(string.Empty, s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value")); @@ -1014,10 +1015,10 @@ namespace BTCPayServer.Tests s.GoToStore(StoreNavPages.Tokens); s.Driver.FindElement(By.Id("CreateNewToken")).Click(); - s.Driver.FindElement(By.Id("RequestPairing")).Click(); + s.ClickPagePrimary(); var pairingCode = AssertUrlHasPairingCode(s); - s.Driver.FindElement(By.Id("ApprovePairing")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); Assert.Contains(pairingCode, s.Driver.PageSource); @@ -1031,15 +1032,15 @@ namespace BTCPayServer.Tests var code = await client.RequestClientAuthorizationAsync("hehe", NBitpayClient.Facade.Merchant); s.Driver.Navigate().GoToUrl(code.CreateLink(s.ServerUri)); - s.Driver.FindElement(By.Id("ApprovePairing")).Click(); + s.ClickPagePrimary(); await client.CreateInvoiceAsync( new NBitpayClient.Invoice() { Price = 1.000000012m, Currency = "USD", FullNotifications = true }, NBitpayClient.Facade.Merchant); s.Driver.Navigate().GoToUrl(s.Link("/api-tokens")); - s.Driver.FindElement(By.Id("RequestPairing")).Click(); - s.Driver.FindElement(By.Id("ApprovePairing")).Click(); + s.ClickPagePrimary(); // Request + s.ClickPagePrimary(); // Approve AssertUrlHasPairingCode(s); } @@ -1157,15 +1158,15 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Title")).SendKeys("Tea shop"); s.Driver.FindElement(By.CssSelector("label[for='DefaultView_Cart']")).Click(); s.Driver.FindElement(By.CssSelector(".template-item:nth-of-type(1)")).Click(); - s.Driver.FindElement(By.Id("BuyButtonText")).SendKeys("Take my money"); + s.Driver.FindElement(By.Id("BuyButtonText")).SendKeys("Take my money"); s.Driver.FindElement(By.Id("EditorCategories-ts-control")).SendKeys("Drinks"); - s.Driver.ScrollTo(By.Id("CodeTabButton")); + s.Driver.ScrollTo(By.Id("CodeTabButton")); s.Driver.FindElement(By.Id("CodeTabButton")).Click(); - var template = s.Driver.FindElement(By.Id("TemplateConfig")).GetAttribute("value"); + var template = s.Driver.FindElement(By.Id("TemplateConfig")).GetAttribute("value"); Assert.Contains("\"buyButtonText\": \"Take my money\"", template); Assert.Matches("\"categories\": \\[\n\\s+\"Drinks\"\n\\s+\\]", template); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("ViewApp")).Click(); @@ -1198,7 +1199,7 @@ namespace BTCPayServer.Tests s.Driver.ScrollTo(By.Id("RootAppId")); var select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId"))); select.SelectByText("Point of", true); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); // Make sure after login, we are not redirected to the PoS s.Logout(); @@ -1218,13 +1219,13 @@ namespace BTCPayServer.Tests s.Driver.ScrollTo(By.Id("RootAppId")); select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId"))); select.SelectByText("None", true); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.ScrollTo(By.Id("RootAppId")); s.Driver.FindElement(By.Id("AddDomainButton")).Click(); s.Driver.FindElement(By.Id("DomainToAppMapping_0__Domain")).SendKeys(new Uri(s.Driver.Url, UriKind.Absolute).DnsSafeHost); select = new SelectElement(s.Driver.FindElement(By.Id("DomainToAppMapping_0__AppId"))); select.SelectByText("Point of", true); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); Assert.Contains("Policies updated successfully", s.FindAlertMessage().Text); // Make sure after login, we are not redirected to the PoS s.Logout(); @@ -1276,13 +1277,13 @@ namespace BTCPayServer.Tests // test wrong dates s.Driver.ExecuteJavaScript("const now = new Date();document.getElementById('StartDate').value = now.toISOString();" + "const yst = new Date(now.setDate(now.getDate() -1));document.getElementById('EndDate').value = yst.toISOString()"); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("End date cannot be before start date", s.Driver.PageSource); Assert.DoesNotContain("App updated", s.Driver.PageSource); // unset end date s.Driver.ExecuteJavaScript("document.getElementById('EndDate').value = ''"); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); var editUrl = s.Driver.Url; @@ -1337,7 +1338,7 @@ namespace BTCPayServer.Tests // Crowdfund with form s.GoToUrl(editUrl); new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("ViewApp")).Click(); @@ -1371,7 +1372,7 @@ namespace BTCPayServer.Tests var template = s.Driver.FindElement(By.Id("TemplateConfig")).GetAttribute("value"); Assert.Contains("\"title\": \"Perk 1\"", template); Assert.Contains("\"id\": \"Perk-1\"", template); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("ViewApp")).Click(); @@ -1402,12 +1403,12 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); // Should give us an error message if we try to create a payment request before adding a wallet - s.Driver.FindElement(By.Id("CreatePaymentRequest")).Click(); + s.ClickPagePrimary(); Assert.Contains("To create a payment request, you need to", s.Driver.PageSource); s.AddDerivationScheme(); s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); - s.Driver.FindElement(By.Id("CreatePaymentRequest")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Id("Title")).SendKeys("Pay123"); s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).SendKeys(".01"); @@ -1417,7 +1418,7 @@ namespace BTCPayServer.Tests currencyInput.Clear(); currencyInput.SendKeys("BTC"); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click(); var editUrl = s.Driver.Url; @@ -1430,7 +1431,7 @@ namespace BTCPayServer.Tests // expire s.Driver.ExecuteJavaScript("document.getElementById('ExpiryDate').value = '2021-01-21T21:00:00.000Z'"); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click(); s.GoToUrl(viewUrl); @@ -1439,7 +1440,7 @@ namespace BTCPayServer.Tests // unexpire s.GoToUrl(editUrl); s.Driver.FindElement(By.Id("ClearExpiryDate")).Click(); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click(); // amount and currency should be editable, because no invoice exists @@ -1606,12 +1607,12 @@ namespace BTCPayServer.Tests TestLogs.LogInformation("Let's create two webhooks"); for (var i = 0; i < 2; i++) { - s.Driver.FindElement(By.Id("CreateWebhook")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Name("PayloadUrl")).SendKeys($"http://127.0.0.1/callback{i}"); new SelectElement(s.Driver.FindElement(By.Id("Everything"))).SelectByValue("false"); s.Driver.FindElement(By.Id("InvoiceCreated")).Click(); s.Driver.FindElement(By.Id("InvoiceProcessing")).Click(); - s.Driver.FindElement(By.Name("add")).Click(); + s.ClickPagePrimary(); } TestLogs.LogInformation("Let's delete one of them"); @@ -2006,7 +2007,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("ConnectionString")).SendKeys("type=lnd-rest;server=https://doesnotwork:8080/"); s.Driver.FindElement(By.Id("test")).Click(); Assert.Contains("Error", s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error).Text); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains("BTC Lightning node updated.", s.FindAlertMessage().Text); // Check offline state is communicated in nav item @@ -2066,7 +2067,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Name")).SendKeys("PP1"); s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).SendKeys("99.0"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); @@ -2082,7 +2083,7 @@ namespace BTCPayServer.Tests name.SendKeys("PP1 Edited"); var description = s.Driver.FindElement(By.ClassName("card-block")); description.SendKeys("Description Edit"); - s.Driver.FindElement(By.Id("SaveButton")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); @@ -2111,7 +2112,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Name")).SendKeys("PP1"); s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).SendKeys("99.0"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); @@ -2125,7 +2126,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Name")).SendKeys("PP2"); s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).SendKeys("100.0"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); // This should select the first View, ie, the last one PP2 s.Driver.FindElement(By.LinkText("View")).Click(); @@ -2230,7 +2231,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Amount")).SendKeys("0.001"); s.Driver.FindElement(By.Id("Currency")).Clear(); s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); @@ -2285,7 +2286,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Amount")).SendKeys(payoutAmount.ToString()); s.Driver.FindElement(By.Id("Currency")).Clear(); s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); @@ -2560,7 +2561,7 @@ namespace BTCPayServer.Tests s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true); s.CreateApp("PointOfSale"); s.Driver.FindElement(By.CssSelector("label[for='DefaultView_Print']")).Click(); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.Driver.FindElement(By.Id("ViewApp")).Click(); @@ -2610,7 +2611,7 @@ namespace BTCPayServer.Tests Assert.False(s.Driver.FindElement(By.Id("ShowDiscount")).Selected); Assert.False(s.Driver.FindElement(By.Id("ShowItems")).Selected); s.Driver.FindElement(By.Id("ShowDiscount")).Click(); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); // View @@ -2726,7 +2727,7 @@ namespace BTCPayServer.Tests // Once more with items s.GoToUrl(editUrl); s.Driver.FindElement(By.Id("ShowItems")).Click(); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); s.GoToUrl(keypadUrl); @@ -2842,7 +2843,7 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("CustomTipPercentages")).SendKeys("10,21"); Assert.False(s.Driver.FindElement(By.Id("ShowDiscount")).Selected); s.Driver.FindElement(By.Id("ShowDiscount")).Click(); - s.Driver.FindElement(By.Id("SaveSettings")).Click(); + s.ClickPagePrimary(); Assert.Contains("App updated", s.FindAlertMessage().Text); // View @@ -3008,7 +3009,7 @@ namespace BTCPayServer.Tests // LNURL is true by default Assert.True(s.Driver.FindElement(By.Id("LNURLEnabled")).Selected); s.Driver.SetCheckbox(By.Name("LUD12Enabled"), true); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); // Topup Invoice test var i = s.CreateInvoice(storeId, null, cryptoCode); @@ -3094,7 +3095,7 @@ namespace BTCPayServer.Tests s.GoToHome(); s.GoToLightningSettings(); s.Driver.SetCheckbox(By.Id("LNURLBech32Mode"), false); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); // Ensure the toggles are set correctly @@ -3112,7 +3113,7 @@ namespace BTCPayServer.Tests s.AddLightningNode(LightningConnectionType.LndREST, false); s.GoToLightningSettings(); s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true); - s.Driver.FindElement(By.Id("save")).Click(); + s.ClickPagePrimary(); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); var invForPP = s.CreateInvoice(null, cryptoCode); s.GoToInvoiceCheckout(invForPP); @@ -3132,7 +3133,7 @@ namespace BTCPayServer.Tests currencyInput.Clear(); currencyInput.SendKeys("BTC"); - s.Driver.FindElement(By.Id("Create")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); var pullPaymentId = s.Driver.Url.Split('/').Last(); @@ -3338,7 +3339,7 @@ namespace BTCPayServer.Tests s.GoToHome(); s.GoToProfile(ManageNavPages.LoginCodes); var code = s.Driver.FindElement(By.Id("logincode")).GetAttribute("value"); - s.Driver.FindElement(By.Id("regeneratecode")).Click(); + s.ClickPagePrimary(); Assert.NotEqual(code, s.Driver.FindElement(By.Id("logincode")).GetAttribute("value")); code = s.Driver.FindElement(By.Id("logincode")).GetAttribute("value"); @@ -3359,7 +3360,7 @@ namespace BTCPayServer.Tests { int maxAttempts = 5; retry: - s.Driver.WaitForAndClick(By.Id("save")); + s.ClickPagePrimary(); try { Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); @@ -3535,12 +3536,12 @@ retry: s.FindAlertMessage(); s.GoToStore(StoreNavPages.Roles); - s.Driver.FindElement(By.Id("CreateRole")).Click(); + s.ClickPagePrimary(); Assert.Contains("Create role", s.Driver.PageSource); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Id("Role")).SendKeys("store role"); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); existingStoreRoles = s.Driver.FindElement(By.CssSelector("table")).FindElements(By.CssSelector("tr")); @@ -3571,12 +3572,12 @@ retry: Assert.DoesNotContain(options, element => element.Text.Equals("store role", StringComparison.InvariantCultureIgnoreCase)); s.GoToStore(StoreNavPages.Roles); - s.Driver.FindElement(By.Id("CreateRole")).Click(); + s.ClickPagePrimary(); s.Driver.FindElement(By.Id("Role")).SendKeys("Malice"); s.Driver.ExecuteJavaScript($"document.getElementById('Policies')['{Policies.CanModifyServerSettings}']=new Option('{Policies.CanModifyServerSettings}', '{Policies.CanModifyServerSettings}', true,true);"); - s.Driver.FindElement(By.Id("Save")).Click(); + s.ClickPagePrimary(); s.FindAlertMessage(); Assert.Contains("Malice",s.Driver.PageSource); Assert.DoesNotContain(Policies.CanModifyServerSettings,s.Driver.PageSource); @@ -3858,11 +3859,11 @@ retry: s.Driver.FindElement(By.Id("Settings_Password")).SendKeys("mypassword"); s.Driver.FindElement(By.Id("Settings_From")).Clear(); s.Driver.FindElement(By.Id("Settings_From")).SendKeys("Firstname Lastname "); - s.Driver.FindElement(By.Id("Save")).SendKeys(Keys.Enter); + s.ClickPagePrimary(); Assert.Contains("Configured", s.Driver.PageSource); s.Driver.FindElement(By.Id("Settings_Login")).Clear(); s.Driver.FindElement(By.Id("Settings_Login")).SendKeys("test_fix@gmail.com"); - s.Driver.FindElement(By.Id("Save")).SendKeys(Keys.Enter); + s.ClickPagePrimary(); Assert.Contains("Configured", s.Driver.PageSource); Assert.Contains("test_fix", s.Driver.PageSource); s.Driver.FindElement(By.Id("ResetPassword")).SendKeys(Keys.Enter); diff --git a/BTCPayServer/Views/Shared/CreateOrEditRole.cshtml b/BTCPayServer/Views/Shared/CreateOrEditRole.cshtml index 575e58745..dd808f4aa 100644 --- a/BTCPayServer/Views/Shared/CreateOrEditRole.cshtml +++ b/BTCPayServer/Views/Shared/CreateOrEditRole.cshtml @@ -32,7 +32,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml index 211e7011b..17525c9bc 100644 --- a/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Shared/Crowdfund/UpdateCrowdfund.cshtml @@ -29,8 +29,8 @@
diff --git a/BTCPayServer/Views/UIManage/APIKeys.cshtml b/BTCPayServer/Views/UIManage/APIKeys.cshtml index 0078a1951..a4c302614 100644 --- a/BTCPayServer/Views/UIManage/APIKeys.cshtml +++ b/BTCPayServer/Views/UIManage/APIKeys.cshtml @@ -9,7 +9,7 @@ diff --git a/BTCPayServer/Views/UIManage/AddApiKey.cshtml b/BTCPayServer/Views/UIManage/AddApiKey.cshtml index a6b45e0c9..1ac98eb58 100644 --- a/BTCPayServer/Views/UIManage/AddApiKey.cshtml +++ b/BTCPayServer/Views/UIManage/AddApiKey.cshtml @@ -36,7 +36,7 @@

@ViewData["Title"]

- +

Generate a new api key to use BTCPay through its API.

diff --git a/BTCPayServer/Views/UIManage/ChangePassword.cshtml b/BTCPayServer/Views/UIManage/ChangePassword.cshtml index 4584c7a41..814eb6da8 100644 --- a/BTCPayServer/Views/UIManage/ChangePassword.cshtml +++ b/BTCPayServer/Views/UIManage/ChangePassword.cshtml @@ -1,4 +1,4 @@ -@model ChangePasswordViewModel +@model ChangePasswordViewModel @{ ViewData.SetActivePage(ManageNavPages.ChangePassword, "Change your password"); } @@ -6,7 +6,7 @@
diff --git a/BTCPayServer/Views/UIManage/Index.cshtml b/BTCPayServer/Views/UIManage/Index.cshtml index 918cd9946..5dd9a8825 100644 --- a/BTCPayServer/Views/UIManage/Index.cshtml +++ b/BTCPayServer/Views/UIManage/Index.cshtml @@ -11,7 +11,7 @@
diff --git a/BTCPayServer/Views/UIManage/LoginCodes.cshtml b/BTCPayServer/Views/UIManage/LoginCodes.cshtml index e5e5067e3..eebc5934d 100644 --- a/BTCPayServer/Views/UIManage/LoginCodes.cshtml +++ b/BTCPayServer/Views/UIManage/LoginCodes.cshtml @@ -5,7 +5,7 @@

Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.

diff --git a/BTCPayServer/Views/UIManage/NotificationSettings.cshtml b/BTCPayServer/Views/UIManage/NotificationSettings.cshtml index 026d79d9f..df2aad043 100644 --- a/BTCPayServer/Views/UIManage/NotificationSettings.cshtml +++ b/BTCPayServer/Views/UIManage/NotificationSettings.cshtml @@ -14,7 +14,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/UIManage/SetPassword.cshtml b/BTCPayServer/Views/UIManage/SetPassword.cshtml index c61df15a0..153a2fe01 100644 --- a/BTCPayServer/Views/UIManage/SetPassword.cshtml +++ b/BTCPayServer/Views/UIManage/SetPassword.cshtml @@ -1,4 +1,4 @@ -@model BTCPayServer.Models.ManageViewModels.SetPasswordViewModel +@model BTCPayServer.Models.ManageViewModels.SetPasswordViewModel @{ ViewData.SetActivePage(ManageNavPages.ChangePassword, "Set your password"); } @@ -6,7 +6,7 @@ diff --git a/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml b/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml index 57452a2b4..16db2e982 100644 --- a/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml +++ b/BTCPayServer/Views/UIOnChainAutomatedPayoutProcessors/Configure.cshtml @@ -18,8 +18,8 @@

@ViewData["Title"]

- - + +
diff --git a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml index f27ce82da..0dd36fe1e 100644 --- a/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml +++ b/BTCPayServer/Views/UIPaymentRequest/EditPaymentRequest.cshtml @@ -35,11 +35,11 @@
@if (string.IsNullOrEmpty(Model.Id)) { - + } else { - + View }
diff --git a/BTCPayServer/Views/UIPaymentRequest/GetPaymentRequests.cshtml b/BTCPayServer/Views/UIPaymentRequest/GetPaymentRequests.cshtml index 5ba61169c..f55854509 100644 --- a/BTCPayServer/Views/UIPaymentRequest/GetPaymentRequests.cshtml +++ b/BTCPayServer/Views/UIPaymentRequest/GetPaymentRequests.cshtml @@ -30,7 +30,7 @@ - + Create Request
diff --git a/BTCPayServer/Views/UIPullPayment/EditPullPayment.cshtml b/BTCPayServer/Views/UIPullPayment/EditPullPayment.cshtml index 441bc200e..26b36fb31 100644 --- a/BTCPayServer/Views/UIPullPayment/EditPullPayment.cshtml +++ b/BTCPayServer/Views/UIPullPayment/EditPullPayment.cshtml @@ -28,11 +28,11 @@
@if (string.IsNullOrEmpty(Model.Id)) { - + } else { - + View }
diff --git a/BTCPayServer/Views/UIReports/StoreReports.cshtml b/BTCPayServer/Views/UIReports/StoreReports.cshtml index 021da340e..a1f1797bd 100644 --- a/BTCPayServer/Views/UIReports/StoreReports.cshtml +++ b/BTCPayServer/Views/UIReports/StoreReports.cshtml @@ -28,7 +28,7 @@
Create fake data - +
diff --git a/BTCPayServer/Views/UIServer/Branding.cshtml b/BTCPayServer/Views/UIServer/Branding.cshtml index 30e5fd212..7a686118e 100644 --- a/BTCPayServer/Views/UIServer/Branding.cshtml +++ b/BTCPayServer/Views/UIServer/Branding.cshtml @@ -1,4 +1,4 @@ -@using BTCPayServer.Abstractions.Contracts +@using BTCPayServer.Abstractions.Contracts @using BTCPayServer.Services @model BrandingViewModel; @inject IFileService FileService @@ -16,7 +16,7 @@ diff --git a/BTCPayServer/Views/UIServer/CreateDictionary.cshtml b/BTCPayServer/Views/UIServer/CreateDictionary.cshtml index c8767a823..dd41d60d5 100644 --- a/BTCPayServer/Views/UIServer/CreateDictionary.cshtml +++ b/BTCPayServer/Views/UIServer/CreateDictionary.cshtml @@ -16,7 +16,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/UIServer/CreateTemporaryFileUrl.cshtml b/BTCPayServer/Views/UIServer/CreateTemporaryFileUrl.cshtml index 922eb414d..b75693591 100644 --- a/BTCPayServer/Views/UIServer/CreateTemporaryFileUrl.cshtml +++ b/BTCPayServer/Views/UIServer/CreateTemporaryFileUrl.cshtml @@ -7,7 +7,7 @@ diff --git a/BTCPayServer/Views/UIServer/CreateUser.cshtml b/BTCPayServer/Views/UIServer/CreateUser.cshtml index 7828fa61a..80b3d0bc7 100644 --- a/BTCPayServer/Views/UIServer/CreateUser.cshtml +++ b/BTCPayServer/Views/UIServer/CreateUser.cshtml @@ -1,4 +1,4 @@ -@model BTCPayServer.Controllers.RegisterFromAdminViewModel +@model BTCPayServer.Controllers.RegisterFromAdminViewModel @{ ViewData.SetActivePage(ServerNavPages.Users, "Create account"); } @@ -14,7 +14,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/UIServer/DynamicDnsService.cshtml b/BTCPayServer/Views/UIServer/DynamicDnsService.cshtml index e1befc07d..5dd2d2a28 100644 --- a/BTCPayServer/Views/UIServer/DynamicDnsService.cshtml +++ b/BTCPayServer/Views/UIServer/DynamicDnsService.cshtml @@ -1,4 +1,4 @@ -@model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel +@model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel @{ ViewData.SetActivePage(ServerNavPages.Services, "Dynamic DNS Service"); } @@ -31,7 +31,7 @@ - +
diff --git a/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml b/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml index 0463ab9ff..62a175140 100644 --- a/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml +++ b/BTCPayServer/Views/UIServer/DynamicDnsServices.cshtml @@ -22,7 +22,7 @@
- +
diff --git a/BTCPayServer/Views/UIServer/EditDictionary.cshtml b/BTCPayServer/Views/UIServer/EditDictionary.cshtml index 8c5c07611..933ca5779 100644 --- a/BTCPayServer/Views/UIServer/EditDictionary.cshtml +++ b/BTCPayServer/Views/UIServer/EditDictionary.cshtml @@ -16,7 +16,7 @@

@ViewData["Title"]

- + diff --git a/BTCPayServer/Views/UIServer/Emails.cshtml b/BTCPayServer/Views/UIServer/Emails.cshtml index b081a57ca..a8c24d25d 100644 --- a/BTCPayServer/Views/UIServer/Emails.cshtml +++ b/BTCPayServer/Views/UIServer/Emails.cshtml @@ -1,4 +1,4 @@ -@model ServerEmailsViewModel +@model ServerEmailsViewModel @{ ViewData.SetActivePage(ServerNavPages.Emails, "Emails"); } @@ -6,7 +6,7 @@
diff --git a/BTCPayServer/Views/UIServer/ListDictionaries.cshtml b/BTCPayServer/Views/UIServer/ListDictionaries.cshtml index f68ed9d39..332441412 100644 --- a/BTCPayServer/Views/UIServer/ListDictionaries.cshtml +++ b/BTCPayServer/Views/UIServer/ListDictionaries.cshtml @@ -7,7 +7,7 @@ diff --git a/BTCPayServer/Views/UIServer/ListUsers.cshtml b/BTCPayServer/Views/UIServer/ListUsers.cshtml index 40ddd8124..27b8a2708 100644 --- a/BTCPayServer/Views/UIServer/ListUsers.cshtml +++ b/BTCPayServer/Views/UIServer/ListUsers.cshtml @@ -15,7 +15,7 @@ } diff --git a/BTCPayServer/Views/UIServer/Policies.cshtml b/BTCPayServer/Views/UIServer/Policies.cshtml index 1e289218d..e7151a594 100644 --- a/BTCPayServer/Views/UIServer/Policies.cshtml +++ b/BTCPayServer/Views/UIServer/Policies.cshtml @@ -21,7 +21,7 @@ diff --git a/BTCPayServer/Views/UIServer/Storage.cshtml b/BTCPayServer/Views/UIServer/Storage.cshtml index a3b20f9f4..f468aa785 100644 --- a/BTCPayServer/Views/UIServer/Storage.cshtml +++ b/BTCPayServer/Views/UIServer/Storage.cshtml @@ -14,7 +14,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/UIServer/User.cshtml b/BTCPayServer/Views/UIServer/User.cshtml index f221cfce7..8611ee3e4 100644 --- a/BTCPayServer/Views/UIServer/User.cshtml +++ b/BTCPayServer/Views/UIServer/User.cshtml @@ -1,4 +1,4 @@ -@using BTCPayServer.Abstractions.Contracts +@using BTCPayServer.Abstractions.Contracts @using Microsoft.AspNetCore.Mvc.TagHelpers @model UsersViewModel.UserViewModel @inject IFileService FileService @@ -17,8 +17,8 @@

@ViewData["Title"]

- - + +
diff --git a/BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml b/BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml index 192659933..1064c6689 100644 --- a/BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml +++ b/BTCPayServer/Views/UIStorePullPayments/NewPullPayment.cshtml @@ -26,7 +26,7 @@

@ViewData["Title"]

- +
diff --git a/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml b/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml index d530d6d06..e41649016 100644 --- a/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml +++ b/BTCPayServer/Views/UIStores/CheckoutAppearance.cshtml @@ -60,7 +60,7 @@ diff --git a/BTCPayServer/Views/UIStores/CreateToken.cshtml b/BTCPayServer/Views/UIStores/CreateToken.cshtml index cdcb2ebbb..b9c01760d 100644 --- a/BTCPayServer/Views/UIStores/CreateToken.cshtml +++ b/BTCPayServer/Views/UIStores/CreateToken.cshtml @@ -1,4 +1,4 @@ -@model CreateTokenViewModel +@model CreateTokenViewModel @{ var store = Context.GetStoreData(); ViewData.SetActivePage(StoreNavPages.Tokens, "Create New Token", store?.Id); @@ -24,7 +24,7 @@ {

@ViewData["Title"]

} - +
diff --git a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml index 07bebe453..6d66b333d 100644 --- a/BTCPayServer/Views/UIStores/GeneralSettings.cshtml +++ b/BTCPayServer/Views/UIStores/GeneralSettings.cshtml @@ -12,7 +12,7 @@ diff --git a/BTCPayServer/Views/UIStores/LightningSettings.cshtml b/BTCPayServer/Views/UIStores/LightningSettings.cshtml index c46407f7c..3f2f68f0e 100644 --- a/BTCPayServer/Views/UIStores/LightningSettings.cshtml +++ b/BTCPayServer/Views/UIStores/LightningSettings.cshtml @@ -9,7 +9,7 @@
diff --git a/BTCPayServer/Views/UIStores/ModifyWebhook.cshtml b/BTCPayServer/Views/UIStores/ModifyWebhook.cshtml index 3a3b98de7..375c28cc4 100644 --- a/BTCPayServer/Views/UIStores/ModifyWebhook.cshtml +++ b/BTCPayServer/Views/UIStores/ModifyWebhook.cshtml @@ -26,11 +26,11 @@ @if (Model.IsNew) { - + } else { - + }
diff --git a/BTCPayServer/Views/UIStores/Rates.cshtml b/BTCPayServer/Views/UIStores/Rates.cshtml index dd6d24fe6..8c08ee5ad 100644 --- a/BTCPayServer/Views/UIStores/Rates.cshtml +++ b/BTCPayServer/Views/UIStores/Rates.cshtml @@ -10,7 +10,7 @@
diff --git a/BTCPayServer/Views/UIStores/RequestPairing.cshtml b/BTCPayServer/Views/UIStores/RequestPairing.cshtml index 53b8a1f6f..18497b170 100644 --- a/BTCPayServer/Views/UIStores/RequestPairing.cshtml +++ b/BTCPayServer/Views/UIStores/RequestPairing.cshtml @@ -1,4 +1,4 @@ -@using BTCPayServer.Abstractions.TagHelpers +@using BTCPayServer.Abstractions.TagHelpers @using BTCPayServer.Client @using Microsoft.AspNetCore.Mvc.TagHelpers @model PairingModel @@ -37,7 +37,7 @@ {

@ViewData["Title"]

} - +
diff --git a/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml b/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml index 5fa2f3e32..55805c5df 100644 --- a/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml +++ b/BTCPayServer/Views/UIStores/SetupLightningNode.cshtml @@ -185,7 +185,7 @@
- +
diff --git a/BTCPayServer/Views/UIStores/StoreEmailSettings.cshtml b/BTCPayServer/Views/UIStores/StoreEmailSettings.cshtml index 2426379ec..58969ff2a 100644 --- a/BTCPayServer/Views/UIStores/StoreEmailSettings.cshtml +++ b/BTCPayServer/Views/UIStores/StoreEmailSettings.cshtml @@ -10,7 +10,7 @@
@if (Model.IsFallbackSetup()) diff --git a/BTCPayServer/Views/UIStores/TestWebhook.cshtml b/BTCPayServer/Views/UIStores/TestWebhook.cshtml index 37b61e6c2..c09b64fc9 100644 --- a/BTCPayServer/Views/UIStores/TestWebhook.cshtml +++ b/BTCPayServer/Views/UIStores/TestWebhook.cshtml @@ -7,7 +7,7 @@
diff --git a/BTCPayServer/Views/UIStores/Webhooks.cshtml b/BTCPayServer/Views/UIStores/Webhooks.cshtml index 6764211f4..adf684dbc 100644 --- a/BTCPayServer/Views/UIStores/Webhooks.cshtml +++ b/BTCPayServer/Views/UIStores/Webhooks.cshtml @@ -9,7 +9,7 @@