Uniform primary action id's of pages (#6118)

This commit is contained in:
Nicolas Dorier
2024-07-25 15:23:28 +09:00
committed by GitHub
parent ca4abcb497
commit 50dafd2452
56 changed files with 185 additions and 173 deletions

View File

@@ -47,7 +47,7 @@ namespace BTCPayServer.Tests
s.GoToLogin(); s.GoToLogin();
s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password);
s.GoToProfile(ManageNavPages.APIKeys); s.GoToProfile(ManageNavPages.APIKeys);
s.Driver.FindElement(By.Id("AddApiKey")).Click(); s.ClickPagePrimary();
//not an admin, so this permission should not show //not an admin, so this permission should not show
Assert.DoesNotContain("btcpay.server.canmodifyserversettings", s.Driver.PageSource); Assert.DoesNotContain("btcpay.server.canmodifyserversettings", s.Driver.PageSource);
@@ -56,34 +56,34 @@ namespace BTCPayServer.Tests
s.GoToLogin(); s.GoToLogin();
s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password);
s.GoToProfile(ManageNavPages.APIKeys); s.GoToProfile(ManageNavPages.APIKeys);
s.Driver.FindElement(By.Id("AddApiKey")).Click(); s.ClickPagePrimary();
Assert.Contains("btcpay.server.canmodifyserversettings", s.Driver.PageSource); Assert.Contains("btcpay.server.canmodifyserversettings", s.Driver.PageSource);
//server management should show now //server management should show now
s.Driver.SetCheckbox(By.Id("btcpay.server.canmodifyserversettings"), true); s.Driver.SetCheckbox(By.Id("btcpay.server.canmodifyserversettings"), true);
s.Driver.SetCheckbox(By.Id("btcpay.store.canmodifystoresettings"), true); s.Driver.SetCheckbox(By.Id("btcpay.store.canmodifystoresettings"), true);
s.Driver.SetCheckbox(By.Id("btcpay.user.canviewprofile"), 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; var superApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
//this api key has access to everything //this api key has access to everything
await TestApiAgainstAccessToken(superApiKey, tester, user, Policies.CanModifyServerSettings, Policies.CanModifyStoreSettings, Policies.CanViewProfile); 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.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; var serverOnlyApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
await TestApiAgainstAccessToken(serverOnlyApiKey, tester, user, await TestApiAgainstAccessToken(serverOnlyApiKey, tester, user,
Policies.CanModifyServerSettings); Policies.CanModifyServerSettings);
s.Driver.FindElement(By.Id("AddApiKey")).Click(); s.ClickPagePrimary();
s.Driver.SetCheckbox(By.Id("btcpay.store.canmodifystoresettings"), true); 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; var allStoreOnlyApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
await TestApiAgainstAccessToken(allStoreOnlyApiKey, tester, user, await TestApiAgainstAccessToken(allStoreOnlyApiKey, tester, user,
Policies.CanModifyStoreSettings); 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(); 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 //there should be a store already by default in the dropdown
var getPermissionValueIndex = var getPermissionValueIndex =
@@ -94,13 +94,13 @@ namespace BTCPayServer.Tests
var option = dropdown.FindElement(By.TagName("option")); var option = dropdown.FindElement(By.TagName("option"));
var storeId = option.GetAttribute("value"); var storeId = option.GetAttribute("value");
option.Click(); option.Click();
s.Driver.WaitForAndClick(By.Id("Generate")); s.ClickPagePrimary();
var selectiveStoreApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; var selectiveStoreApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
await TestApiAgainstAccessToken(selectiveStoreApiKey, tester, user, await TestApiAgainstAccessToken(selectiveStoreApiKey, tester, user,
Permission.Create(Policies.CanModifyStoreSettings, storeId).ToString()); Permission.Create(Policies.CanModifyStoreSettings, storeId).ToString());
s.Driver.WaitForAndClick(By.Id("AddApiKey")); s.ClickPagePrimary(); // New API key
s.Driver.WaitForAndClick(By.Id("Generate")); s.ClickPagePrimary(); // Generate
var noPermissionsApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; var noPermissionsApiKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
await TestApiAgainstAccessToken(noPermissionsApiKey, tester, user); await TestApiAgainstAccessToken(noPermissionsApiKey, tester, user);
await Assert.ThrowsAnyAsync<HttpRequestException>(async () => await Assert.ThrowsAnyAsync<HttpRequestException>(async () =>
@@ -223,12 +223,12 @@ namespace BTCPayServer.Tests
s.GoToLogin(); s.GoToLogin();
s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password); s.LogIn(user.RegisterDetails.Email, user.RegisterDetails.Password);
s.GoToUrl("/account/apikeys"); s.GoToUrl("/account/apikeys");
s.Driver.WaitForAndClick(By.Id("AddApiKey")); s.ClickPagePrimary();
int checkedPermissionCount = s.Driver.FindElements(By.ClassName("form-check-input")).Count; int checkedPermissionCount = s.Driver.FindElements(By.ClassName("form-check-input")).Count;
s.Driver.ExecuteJavaScript("document.querySelectorAll('#Permissions .form-check-input').forEach(i => i.click())"); s.Driver.ExecuteJavaScript("document.querySelectorAll('#Permissions .form-check-input').forEach(i => i.click())");
TestLogs.LogInformation("Generating API key"); TestLogs.LogInformation("Generating API key");
s.Driver.WaitForAndClick(By.Id("Generate")); s.ClickPagePrimary();
var allAPIKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text; var allAPIKey = s.FindAlertMessage().FindElement(By.TagName("code")).Text;
TestLogs.LogInformation($"Checking API key permissions: {allAPIKey}"); TestLogs.LogInformation($"Checking API key permissions: {allAPIKey}");

View File

@@ -38,7 +38,7 @@ namespace BTCPayServer.Tests
var supportUrl = "https://support.satoshisteaks.com/{InvoiceId}/"; var supportUrl = "https://support.satoshisteaks.com/{InvoiceId}/";
s.GoToStore(); s.GoToStore();
s.Driver.FindElement(By.Id("StoreWebsite")).SendKeys(storeUrl); 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); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text);
s.GoToStore(StoreNavPages.CheckoutAppearance); s.GoToStore(StoreNavPages.CheckoutAppearance);
@@ -46,7 +46,7 @@ namespace BTCPayServer.Tests
s.Driver.WaitForAndClick(By.Id("Presets_InStore")); s.Driver.WaitForAndClick(By.Id("Presets_InStore"));
Assert.True(s.Driver.SetCheckbox(By.Id("ShowPayInWalletButton"), true)); Assert.True(s.Driver.SetCheckbox(By.Id("ShowPayInWalletButton"), true));
s.Driver.FindElement(By.Id("SupportUrl")).SendKeys(supportUrl); 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); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text);
// Top up/zero amount invoices // Top up/zero amount invoices
@@ -105,7 +105,7 @@ namespace BTCPayServer.Tests
s.GoToHome(); s.GoToHome();
s.GoToLightningSettings(); s.GoToLightningSettings();
s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), true); 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); Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text);
s.GoToInvoiceCheckout(invoiceId); s.GoToInvoiceCheckout(invoiceId);
Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text); Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text);
@@ -251,7 +251,7 @@ namespace BTCPayServer.Tests
s.GoToStore(StoreNavPages.CheckoutAppearance); s.GoToStore(StoreNavPages.CheckoutAppearance);
s.Driver.SetCheckbox(By.Id("OnChainWithLnInvoiceFallback"), true); s.Driver.SetCheckbox(By.Id("OnChainWithLnInvoiceFallback"), true);
s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), false); s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), false);
s.Driver.FindElement(By.Id("Save")).Click(); s.ClickPagePrimary();
Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text);
invoiceId = s.CreateInvoice(); invoiceId = s.CreateInvoice();
@@ -285,7 +285,7 @@ namespace BTCPayServer.Tests
s.GoToHome(); s.GoToHome();
s.GoToStore(StoreNavPages.CheckoutAppearance); s.GoToStore(StoreNavPages.CheckoutAppearance);
s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), true); s.Driver.SetCheckbox(By.Id("LightningAmountInSatoshi"), true);
s.Driver.FindElement(By.Id("Save")).Click(); s.ClickPagePrimary();
Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text);
s.GoToInvoiceCheckout(invoiceId); s.GoToInvoiceCheckout(invoiceId);
Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text); Assert.Contains("sats", s.Driver.FindElement(By.Id("AmountDue")).Text);
@@ -368,7 +368,7 @@ namespace BTCPayServer.Tests
Assert.Equal("5", displayExpirationTimer.GetAttribute("value")); Assert.Equal("5", displayExpirationTimer.GetAttribute("value"));
displayExpirationTimer.Clear(); displayExpirationTimer.Clear();
displayExpirationTimer.SendKeys("10"); displayExpirationTimer.SendKeys("10");
s.Driver.FindElement(By.Id("Save")).Click(); s.ClickPagePrimary();
Assert.Contains("Store successfully updated", s.FindAlertMessage().Text); Assert.Contains("Store successfully updated", s.FindAlertMessage().Text);
s.GoToInvoiceCheckout(invoiceId); s.GoToInvoiceCheckout(invoiceId);
@@ -392,8 +392,7 @@ namespace BTCPayServer.Tests
s.GoToHome(); s.GoToHome();
s.GoToLightningSettings(); s.GoToLightningSettings();
s.Driver.SetCheckbox(By.Id("LNURLEnabled"), false); s.Driver.SetCheckbox(By.Id("LNURLEnabled"), false);
s.Driver.ScrollTo(By.Id("save")); s.ClickPagePrimary();
s.Driver.FindElement(By.Id("save")).Click();
Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text); Assert.Contains("BTC Lightning settings successfully updated", s.FindAlertMessage().Text);
// Test: // Test:

View File

@@ -46,15 +46,15 @@ namespace BTCPayServer.Tests
// Create English (Custom) // Create English (Custom)
tester.LogIn(); tester.LogIn();
tester.GoToServer(Views.Server.ServerNavPages.Translations); 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.Name("Name")).SendKeys("English (Custom)");
tester.Driver.FindElement(By.Id("Create")).Click(); tester.ClickPagePrimary();
var translations = tester.Driver.FindElement(By.Name("Translations")); var translations = tester.Driver.FindElement(By.Name("Translations"));
var text = translations.Text; var text = translations.Text;
text = text.Replace("Password => Password", "Password => Mot de passe"); text = text.Replace("Password => Password", "Password => Mot de passe");
translations.Clear(); translations.Clear();
translations.SendKeys("Password => Mot de passe"); translations.SendKeys("Password => Mot de passe");
tester.Driver.FindElement(By.Id("SaveButton")).Click(); tester.ClickPagePrimary();
// Check English (Custom) can be selected // Check English (Custom) can be selected
tester.Driver.FindElement(By.Id("Select-English (Custom)")).Click(); tester.Driver.FindElement(By.Id("Select-English (Custom)")).Click();

View File

@@ -325,14 +325,14 @@ retry:
} }
} }
Driver.FindElement(By.Id("save")).Click(); ClickPagePrimary();
Assert.Contains($"{cryptoCode} Lightning node updated.", FindAlertMessage().Text); Assert.Contains($"{cryptoCode} Lightning node updated.", FindAlertMessage().Text);
var enabled = Driver.FindElement(By.Id($"{cryptoCode}LightningEnabled")); var enabled = Driver.FindElement(By.Id($"{cryptoCode}LightningEnabled"));
if (enabled.Selected == false) if (enabled.Selected == false)
{ {
enabled.Click(); enabled.Click();
Driver.FindElement(By.Id("save")).Click(); ClickPagePrimary();
Assert.Contains($"{cryptoCode} Lightning settings successfully updated", FindAlertMessage().Text); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", FindAlertMessage().Text);
} }
} }
@@ -517,7 +517,7 @@ retry:
{ {
GoToInvoices(storeId); GoToInvoices(storeId);
Driver.FindElement(By.Id("CreateNewInvoice")).Click(); ClickPagePrimary();
if (amount is decimal v) if (amount is decimal v)
Driver.FindElement(By.Id("Amount")).SendKeys(v.ToString(CultureInfo.InvariantCulture)); Driver.FindElement(By.Id("Amount")).SendKeys(v.ToString(CultureInfo.InvariantCulture));
var currencyEl = Driver.FindElement(By.Id("Currency")); var currencyEl = Driver.FindElement(By.Id("Currency"));
@@ -526,7 +526,7 @@ retry:
Driver.FindElement(By.Id("BuyerEmail")).SendKeys(refundEmail); Driver.FindElement(By.Id("BuyerEmail")).SendKeys(refundEmail);
if (defaultPaymentMethod is not null) if (defaultPaymentMethod is not null)
new SelectElement(Driver.FindElement(By.Name("DefaultPaymentMethod"))).SelectByValue(defaultPaymentMethod); new SelectElement(Driver.FindElement(By.Name("DefaultPaymentMethod"))).SelectByValue(defaultPaymentMethod);
Driver.FindElement(By.Id("Create")).Click(); ClickPagePrimary();
var statusElement = FindAlertMessage(expectedSeverity); var statusElement = FindAlertMessage(expectedSeverity);
var inv = expectedSeverity == StatusMessageModel.StatusSeverity.Success ? statusElement.Text.Split(" ")[1] : null; var inv = expectedSeverity == StatusMessageModel.StatusSeverity.Success ? statusElement.Text.Split(" ")[1] : null;
@@ -643,10 +643,22 @@ retry:
name = $"{type}-{Guid.NewGuid().ToString()[..14]}"; name = $"{type}-{Guid.NewGuid().ToString()[..14]}";
Driver.FindElement(By.Id($"StoreNav-Create{type}")).Click(); Driver.FindElement(By.Id($"StoreNav-Create{type}")).Click();
Driver.FindElement(By.Name("AppName")).SendKeys(name); Driver.FindElement(By.Name("AppName")).SendKeys(name);
Driver.FindElement(By.Id("Create")).Click(); ClickPagePrimary();
Assert.Contains("App successfully created", FindAlertMessage().Text); Assert.Contains("App successfully created", FindAlertMessage().Text);
var appId = Driver.Url.Split('/')[4]; var appId = Driver.Url.Split('/')[4];
return (name, appId); return (name, appId);
} }
public void ClickPagePrimary()
{
try
{
Driver.FindElement(By.Id("page-primary")).Click();
}
catch (NoSuchElementException)
{
Driver.WaitForAndClick(By.Id("page-primary"));
}
}
} }
} }

View File

@@ -84,11 +84,11 @@ namespace BTCPayServer.Tests
var appName = $"PoS-{Guid.NewGuid().ToString()[..21]}"; var appName = $"PoS-{Guid.NewGuid().ToString()[..21]}";
s.Driver.FindElement(By.Id("StoreNav-CreatePointOfSale")).Click(); s.Driver.FindElement(By.Id("StoreNav-CreatePointOfSale")).Click();
s.Driver.FindElement(By.Id("AppName")).SendKeys(appName); 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); Assert.Contains("App successfully created", s.FindAlertMessage().Text);
new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); 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); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("ViewApp")).Click(); s.Driver.FindElement(By.Id("ViewApp")).Click();
@@ -110,12 +110,13 @@ namespace BTCPayServer.Tests
// Payment Request // Payment Request
s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click();
s.Driver.FindElement(By.Id("CreatePaymentRequest")).Click(); s.ClickPagePrimary();
Thread.Sleep(10000); Thread.Sleep(10000);
s.Driver.FindElement(By.Id("Title")).SendKeys("Pay123"); s.Driver.FindElement(By.Id("Title")).SendKeys("Pay123");
s.Driver.FindElement(By.Id("Amount")).SendKeys("700"); s.Driver.FindElement(By.Id("Amount")).SendKeys("700");
new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); 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(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click();
var editUrl = s.Driver.Url; var editUrl = s.Driver.Url;
@@ -127,7 +128,7 @@ namespace BTCPayServer.Tests
Assert.Contains("Enter your email", s.Driver.PageSource); Assert.Contains("Enter your email", s.Driver.PageSource);
s.Driver.FindElement(By.Name("buyerEmail")).SendKeys("aa@aa.com"); 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(); invoiceId = s.Driver.Url.Split('/').Last();
s.Driver.Close(); s.Driver.Close();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.First()); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.First());
@@ -140,7 +141,7 @@ namespace BTCPayServer.Tests
//Custom Forms //Custom Forms
s.GoToStore(StoreNavPages.Forms); s.GoToStore(StoreNavPages.Forms);
Assert.Contains("There are no forms yet.", s.Driver.PageSource); 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.Name("Name")).SendKeys("Custom Form 1");
s.Driver.FindElement(By.Id("ApplyEmailTemplate")).Click(); 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")).Clear();
s.Driver.FindElement(By.Name("FormConfig")) s.Driver.FindElement(By.Name("FormConfig"))
.SendKeys(config.Replace("Enter your email", "CustomFormInputTest")); .SendKeys(config.Replace("Enter your email", "CustomFormInputTest"));
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.Id("ViewForm")).Click(); s.Driver.FindElement(By.Id("ViewForm")).Click();
var formurl = s.Driver.Url; var formurl = s.Driver.Url;
@@ -172,7 +173,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("ConfirmContinue")).Click(); s.Driver.FindElement(By.Id("ConfirmContinue")).Click();
Assert.DoesNotContain("Custom Form 1", s.Driver.PageSource); 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.Name("Name")).SendKeys("Custom Form 2");
s.Driver.FindElement(By.Id("ApplyEmailTemplate")).Click(); 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")).Clear();
s.Driver.FindElement(By.Name("FormConfig")) s.Driver.FindElement(By.Name("FormConfig"))
.SendKeys(config.Replace("Enter your email", "CustomFormInputTest2")); .SendKeys(config.Replace("Enter your email", "CustomFormInputTest2"));
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.Id("ViewForm")).Click(); s.Driver.FindElement(By.Id("ViewForm")).Click();
formurl = s.Driver.Url; formurl = s.Driver.Url;
result = await s.Server.PayTester.HttpClient.GetAsync(formurl); 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")).Clear();
s.Driver.FindElement(By.Name("Name")).SendKeys("Custom Form 3"); s.Driver.FindElement(By.Name("Name")).SendKeys("Custom Form 3");
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.GoToStore(StoreNavPages.Forms); s.GoToStore(StoreNavPages.Forms);
Assert.Contains("Custom Form 3", s.Driver.PageSource); Assert.Contains("Custom Form 3", s.Driver.PageSource);
s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); 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); Assert.Equal(4, new SelectElement(s.Driver.FindElement(By.Id("FormId"))).Options.Count);
} }
@@ -296,7 +297,7 @@ namespace BTCPayServer.Tests
s.GoToProfile(); s.GoToProfile();
s.Driver.FindElement(By.Id("Email")).Clear(); s.Driver.FindElement(By.Id("Email")).Clear();
s.Driver.FindElement(By.Id("Email")).SendKeys(u2.RegisterDetails.Email); 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.", Assert.Contains("The email address is already in use with an other account.",
s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error).Text); s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error).Text);
@@ -305,7 +306,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("Email")).Clear(); s.Driver.FindElement(By.Id("Email")).Clear();
var changedEmail = Guid.NewGuid() + "@lol.com"; var changedEmail = Guid.NewGuid() + "@lol.com";
s.Driver.FindElement(By.Id("Email")).SendKeys(changedEmail); s.Driver.FindElement(By.Id("Email")).SendKeys(changedEmail);
s.Driver.FindElement(By.Id("save")).Click(); s.ClickPagePrimary();
s.FindAlertMessage(); s.FindAlertMessage();
var manager = tester.PayTester.GetService<UserManager<ApplicationUser>>(); var manager = tester.PayTester.GetService<UserManager<ApplicationUser>>();
@@ -348,7 +349,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("OldPassword")).SendKeys("123456"); s.Driver.FindElement(By.Id("OldPassword")).SendKeys("123456");
s.Driver.FindElement(By.Id("NewPassword")).SendKeys(newPassword); s.Driver.FindElement(By.Id("NewPassword")).SendKeys(newPassword);
s.Driver.FindElement(By.Id("ConfirmPassword")).SendKeys(newPassword); s.Driver.FindElement(By.Id("ConfirmPassword")).SendKeys(newPassword);
s.Driver.FindElement(By.Id("UpdatePassword")).Click(); s.ClickPagePrimary();
s.Logout(); s.Logout();
s.Driver.AssertNoError(); s.Driver.AssertNoError();
@@ -367,11 +368,11 @@ namespace BTCPayServer.Tests
s.RegisterNewUser(true); s.RegisterNewUser(true);
s.GoToHome(); s.GoToHome();
s.GoToServer(ServerNavPages.Users); s.GoToServer(ServerNavPages.Users);
s.Driver.FindElement(By.Id("CreateUser")).Click(); s.ClickPagePrimary();
var usr = RandomUtils.GetUInt256().ToString().Substring(64 - 20) + "@a.com"; var usr = RandomUtils.GetUInt256().ToString().Substring(64 - 20) + "@a.com";
s.Driver.FindElement(By.Id("Email")).SendKeys(usr); 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; var url = s.FindAlertMessage().FindElement(By.TagName("a")).Text;
s.Logout(); s.Logout();
@@ -383,7 +384,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("Password")).SendKeys("123456"); s.Driver.FindElement(By.Id("Password")).SendKeys("123456");
s.Driver.FindElement(By.Id("ConfirmPassword")).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); Assert.Contains("Account successfully created.", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("Email")).SendKeys(usr); 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.True(s.Driver.FindElement(By.Id("EnableRegistration")).Selected);
Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected);
s.Driver.FindElement(By.Id("RequiresUserApproval")).Click(); 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.Contains("Policies updated successfully", s.FindAlertMessage().Text);
Assert.True(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); 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("EnableRegistration")).Selected);
Assert.True(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); Assert.True(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected);
s.Driver.FindElement(By.Id("RequiresUserApproval")).Click(); 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.Contains("Policies updated successfully", s.FindAlertMessage().Text);
Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected); Assert.False(s.Driver.FindElement(By.Id("RequiresUserApproval")).Selected);
// Check user create view does not have approval checkbox // Check user create view does not have approval checkbox
s.GoToServer(ServerNavPages.Users); s.GoToServer(ServerNavPages.Users);
s.Driver.FindElement(By.Id("CreateUser")).Click(); s.ClickPagePrimary();
s.Driver.ElementDoesNotExist(By.Id("Approved")); s.Driver.ElementDoesNotExist(By.Id("Approved"));
s.Logout(); s.Logout();
@@ -521,7 +522,7 @@ namespace BTCPayServer.Tests
// Approve user // Approve user
s.Driver.FindElement(By.CssSelector("#UsersList tr.user-overview-row:first-child .user-edit")).Click(); 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("Approved")).Click();
s.Driver.FindElement(By.Id("SaveUser")).Click(); s.ClickPagePrimary();
Assert.Contains("User successfully updated", s.FindAlertMessage().Text); Assert.Contains("User successfully updated", s.FindAlertMessage().Text);
// Check list again // Check list again
s.GoToServer(ServerNavPages.Users); 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_Login")).Clear();
s.Driver.FindElement(By.Id("Settings_Password")).Clear(); s.Driver.FindElement(By.Id("Settings_Password")).Clear();
s.Driver.FindElement(By.Id("Settings_From")).Clear(); s.Driver.FindElement(By.Id("Settings_From")).Clear();
s.Driver.FindElement(By.Id("Save")).Submit(); s.ClickPagePrimary();
// Store Emails without server fallback // Store Emails without server fallback
s.GoToStore(StoreNavPages.Emails); s.GoToStore(StoreNavPages.Emails);
@@ -680,7 +681,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("ConfirmContinue")).Click(); s.Driver.FindElement(By.Id("ConfirmContinue")).Click();
} }
s.Driver.FindElement(By.Id("AddDynamicDNS")).Click(); s.ClickPagePrimary();
s.Driver.AssertNoError(); s.Driver.AssertNoError();
// We will just cheat for test purposes by only querying the server // We will just cheat for test purposes by only querying the server
s.Driver.FindElement(By.Id("ServiceUrl")).SendKeys(s.Link("/")); 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); Assert.EndsWith("/server/services/dynamic-dns", s.Driver.Url);
// Try to do the same thing should fail (hostname already exists) // 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.AssertNoError();
s.Driver.FindElement(By.Id("ServiceUrl")).SendKeys(s.Link("/")); s.Driver.FindElement(By.Id("ServiceUrl")).SendKeys(s.Link("/"));
s.Driver.FindElement(By.Id("Settings_Hostname")).SendKeys("pouet.hello.com"); s.Driver.FindElement(By.Id("Settings_Hostname")).SendKeys("pouet.hello.com");
@@ -721,7 +722,7 @@ namespace BTCPayServer.Tests
s.GoToInvoices(); s.GoToInvoices();
// Should give us an error message if we try to create an invoice before adding a wallet // 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); Assert.Contains("To create an invoice, you need to", s.Driver.PageSource);
s.AddDerivationScheme(); s.AddDerivationScheme();
@@ -955,18 +956,18 @@ namespace BTCPayServer.Tests
s.GoToStore(); s.GoToStore();
Assert.False(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected); Assert.False(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected);
s.Driver.SetCheckbox(By.Id("AnyoneCanCreateInvoice"), true); s.Driver.SetCheckbox(By.Id("AnyoneCanCreateInvoice"), true);
s.Driver.FindElement(By.Id("Save")).Click(); s.ClickPagePrimary();
s.FindAlertMessage(); s.FindAlertMessage();
Assert.True(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected); Assert.True(s.Driver.FindElement(By.Id("AnyoneCanCreateInvoice")).Selected);
// Store settings: Set and unset brand color // Store settings: Set and unset brand color
s.GoToStore(); s.GoToStore();
s.Driver.FindElement(By.Id("BrandColor")).SendKeys("#f7931a"); 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.Contains("Store successfully updated", s.FindAlertMessage().Text);
Assert.Equal("#f7931a", s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value")); Assert.Equal("#f7931a", s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value"));
s.Driver.FindElement(By.Id("BrandColor")).Clear(); 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.Contains("Store successfully updated", s.FindAlertMessage().Text);
Assert.Equal(string.Empty, s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value")); Assert.Equal(string.Empty, s.Driver.FindElement(By.Id("BrandColor")).GetAttribute("value"));
@@ -1014,10 +1015,10 @@ namespace BTCPayServer.Tests
s.GoToStore(StoreNavPages.Tokens); s.GoToStore(StoreNavPages.Tokens);
s.Driver.FindElement(By.Id("CreateNewToken")).Click(); s.Driver.FindElement(By.Id("CreateNewToken")).Click();
s.Driver.FindElement(By.Id("RequestPairing")).Click(); s.ClickPagePrimary();
var pairingCode = AssertUrlHasPairingCode(s); var pairingCode = AssertUrlHasPairingCode(s);
s.Driver.FindElement(By.Id("ApprovePairing")).Click(); s.ClickPagePrimary();
s.FindAlertMessage(); s.FindAlertMessage();
Assert.Contains(pairingCode, s.Driver.PageSource); Assert.Contains(pairingCode, s.Driver.PageSource);
@@ -1031,15 +1032,15 @@ namespace BTCPayServer.Tests
var code = await client.RequestClientAuthorizationAsync("hehe", NBitpayClient.Facade.Merchant); var code = await client.RequestClientAuthorizationAsync("hehe", NBitpayClient.Facade.Merchant);
s.Driver.Navigate().GoToUrl(code.CreateLink(s.ServerUri)); s.Driver.Navigate().GoToUrl(code.CreateLink(s.ServerUri));
s.Driver.FindElement(By.Id("ApprovePairing")).Click(); s.ClickPagePrimary();
await client.CreateInvoiceAsync( await client.CreateInvoiceAsync(
new NBitpayClient.Invoice() { Price = 1.000000012m, Currency = "USD", FullNotifications = true }, new NBitpayClient.Invoice() { Price = 1.000000012m, Currency = "USD", FullNotifications = true },
NBitpayClient.Facade.Merchant); NBitpayClient.Facade.Merchant);
s.Driver.Navigate().GoToUrl(s.Link("/api-tokens")); s.Driver.Navigate().GoToUrl(s.Link("/api-tokens"));
s.Driver.FindElement(By.Id("RequestPairing")).Click(); s.ClickPagePrimary(); // Request
s.Driver.FindElement(By.Id("ApprovePairing")).Click(); s.ClickPagePrimary(); // Approve
AssertUrlHasPairingCode(s); AssertUrlHasPairingCode(s);
} }
@@ -1165,7 +1166,7 @@ namespace BTCPayServer.Tests
Assert.Contains("\"buyButtonText\": \"Take my money\"", template); Assert.Contains("\"buyButtonText\": \"Take my money\"", template);
Assert.Matches("\"categories\": \\[\n\\s+\"Drinks\"\n\\s+\\]", 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); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("ViewApp")).Click(); s.Driver.FindElement(By.Id("ViewApp")).Click();
@@ -1198,7 +1199,7 @@ namespace BTCPayServer.Tests
s.Driver.ScrollTo(By.Id("RootAppId")); s.Driver.ScrollTo(By.Id("RootAppId"));
var select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId"))); var select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId")));
select.SelectByText("Point of", true); select.SelectByText("Point of", true);
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.FindAlertMessage(); s.FindAlertMessage();
// Make sure after login, we are not redirected to the PoS // Make sure after login, we are not redirected to the PoS
s.Logout(); s.Logout();
@@ -1218,13 +1219,13 @@ namespace BTCPayServer.Tests
s.Driver.ScrollTo(By.Id("RootAppId")); s.Driver.ScrollTo(By.Id("RootAppId"));
select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId"))); select = new SelectElement(s.Driver.FindElement(By.Id("RootAppId")));
select.SelectByText("None", true); select.SelectByText("None", true);
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.Driver.ScrollTo(By.Id("RootAppId")); s.Driver.ScrollTo(By.Id("RootAppId"));
s.Driver.FindElement(By.Id("AddDomainButton")).Click(); s.Driver.FindElement(By.Id("AddDomainButton")).Click();
s.Driver.FindElement(By.Id("DomainToAppMapping_0__Domain")).SendKeys(new Uri(s.Driver.Url, UriKind.Absolute).DnsSafeHost); 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 = new SelectElement(s.Driver.FindElement(By.Id("DomainToAppMapping_0__AppId")));
select.SelectByText("Point of", true); select.SelectByText("Point of", true);
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
Assert.Contains("Policies updated successfully", s.FindAlertMessage().Text); Assert.Contains("Policies updated successfully", s.FindAlertMessage().Text);
// Make sure after login, we are not redirected to the PoS // Make sure after login, we are not redirected to the PoS
s.Logout(); s.Logout();
@@ -1276,13 +1277,13 @@ namespace BTCPayServer.Tests
// test wrong dates // test wrong dates
s.Driver.ExecuteJavaScript("const now = new Date();document.getElementById('StartDate').value = now.toISOString();" + 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()"); "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.Contains("End date cannot be before start date", s.Driver.PageSource);
Assert.DoesNotContain("App updated", s.Driver.PageSource); Assert.DoesNotContain("App updated", s.Driver.PageSource);
// unset end date // unset end date
s.Driver.ExecuteJavaScript("document.getElementById('EndDate').value = ''"); s.Driver.ExecuteJavaScript("document.getElementById('EndDate').value = ''");
s.Driver.FindElement(By.Id("SaveSettings")).Click(); s.ClickPagePrimary();
Assert.Contains("App updated", s.FindAlertMessage().Text); Assert.Contains("App updated", s.FindAlertMessage().Text);
var editUrl = s.Driver.Url; var editUrl = s.Driver.Url;
@@ -1337,7 +1338,7 @@ namespace BTCPayServer.Tests
// Crowdfund with form // Crowdfund with form
s.GoToUrl(editUrl); s.GoToUrl(editUrl);
new SelectElement(s.Driver.FindElement(By.Id("FormId"))).SelectByValue("Email"); 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); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("ViewApp")).Click(); s.Driver.FindElement(By.Id("ViewApp")).Click();
@@ -1371,7 +1372,7 @@ namespace BTCPayServer.Tests
var template = s.Driver.FindElement(By.Id("TemplateConfig")).GetAttribute("value"); var template = s.Driver.FindElement(By.Id("TemplateConfig")).GetAttribute("value");
Assert.Contains("\"title\": \"Perk 1\"", template); Assert.Contains("\"title\": \"Perk 1\"", template);
Assert.Contains("\"id\": \"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); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("ViewApp")).Click(); s.Driver.FindElement(By.Id("ViewApp")).Click();
@@ -1402,12 +1403,12 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); 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 // 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); Assert.Contains("To create a payment request, you need to", s.Driver.PageSource);
s.AddDerivationScheme(); s.AddDerivationScheme();
s.Driver.FindElement(By.Id("StoreNav-PaymentRequests")).Click(); 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("Title")).SendKeys("Pay123");
s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).Clear();
s.Driver.FindElement(By.Id("Amount")).SendKeys(".01"); s.Driver.FindElement(By.Id("Amount")).SendKeys(".01");
@@ -1417,7 +1418,7 @@ namespace BTCPayServer.Tests
currencyInput.Clear(); currencyInput.Clear();
currencyInput.SendKeys("BTC"); currencyInput.SendKeys("BTC");
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click();
var editUrl = s.Driver.Url; var editUrl = s.Driver.Url;
@@ -1430,7 +1431,7 @@ namespace BTCPayServer.Tests
// expire // expire
s.Driver.ExecuteJavaScript("document.getElementById('ExpiryDate').value = '2021-01-21T21:00:00.000Z'"); 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.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click();
s.GoToUrl(viewUrl); s.GoToUrl(viewUrl);
@@ -1439,7 +1440,7 @@ namespace BTCPayServer.Tests
// unexpire // unexpire
s.GoToUrl(editUrl); s.GoToUrl(editUrl);
s.Driver.FindElement(By.Id("ClearExpiryDate")).Click(); 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(); s.Driver.FindElement(By.XPath("//a[starts-with(@id, 'Edit-')]")).Click();
// amount and currency should be editable, because no invoice exists // amount and currency should be editable, because no invoice exists
@@ -1606,12 +1607,12 @@ namespace BTCPayServer.Tests
TestLogs.LogInformation("Let's create two webhooks"); TestLogs.LogInformation("Let's create two webhooks");
for (var i = 0; i < 2; i++) 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}"); s.Driver.FindElement(By.Name("PayloadUrl")).SendKeys($"http://127.0.0.1/callback{i}");
new SelectElement(s.Driver.FindElement(By.Id("Everything"))).SelectByValue("false"); new SelectElement(s.Driver.FindElement(By.Id("Everything"))).SelectByValue("false");
s.Driver.FindElement(By.Id("InvoiceCreated")).Click(); s.Driver.FindElement(By.Id("InvoiceCreated")).Click();
s.Driver.FindElement(By.Id("InvoiceProcessing")).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"); 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("ConnectionString")).SendKeys("type=lnd-rest;server=https://doesnotwork:8080/");
s.Driver.FindElement(By.Id("test")).Click(); s.Driver.FindElement(By.Id("test")).Click();
Assert.Contains("Error", s.FindAlertMessage(StatusMessageModel.StatusSeverity.Error).Text); 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); Assert.Contains("BTC Lightning node updated.", s.FindAlertMessage().Text);
// Check offline state is communicated in nav item // 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("Name")).SendKeys("PP1");
s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).Clear();
s.Driver.FindElement(By.Id("Amount")).SendKeys("99.0"); 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.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last());
@@ -2082,7 +2083,7 @@ namespace BTCPayServer.Tests
name.SendKeys("PP1 Edited"); name.SendKeys("PP1 Edited");
var description = s.Driver.FindElement(By.ClassName("card-block")); var description = s.Driver.FindElement(By.ClassName("card-block"));
description.SendKeys("Description Edit"); description.SendKeys("Description Edit");
s.Driver.FindElement(By.Id("SaveButton")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); 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("Name")).SendKeys("PP1");
s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).Clear();
s.Driver.FindElement(By.Id("Amount")).SendKeys("99.0"); 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.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); 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("Name")).SendKeys("PP2");
s.Driver.FindElement(By.Id("Amount")).Clear(); s.Driver.FindElement(By.Id("Amount")).Clear();
s.Driver.FindElement(By.Id("Amount")).SendKeys("100.0"); 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 // This should select the first View, ie, the last one PP2
s.Driver.FindElement(By.LinkText("View")).Click(); 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("Amount")).SendKeys("0.001");
s.Driver.FindElement(By.Id("Currency")).Clear(); s.Driver.FindElement(By.Id("Currency")).Clear();
s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC"); 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.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); 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("Amount")).SendKeys(payoutAmount.ToString());
s.Driver.FindElement(By.Id("Currency")).Clear(); s.Driver.FindElement(By.Id("Currency")).Clear();
s.Driver.FindElement(By.Id("Currency")).SendKeys("BTC"); 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.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last());
@@ -2560,7 +2561,7 @@ namespace BTCPayServer.Tests
s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true); s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true);
s.CreateApp("PointOfSale"); s.CreateApp("PointOfSale");
s.Driver.FindElement(By.CssSelector("label[for='DefaultView_Print']")).Click(); 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); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.Driver.FindElement(By.Id("ViewApp")).Click(); 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("ShowDiscount")).Selected);
Assert.False(s.Driver.FindElement(By.Id("ShowItems")).Selected); Assert.False(s.Driver.FindElement(By.Id("ShowItems")).Selected);
s.Driver.FindElement(By.Id("ShowDiscount")).Click(); s.Driver.FindElement(By.Id("ShowDiscount")).Click();
s.Driver.FindElement(By.Id("SaveSettings")).Click(); s.ClickPagePrimary();
Assert.Contains("App updated", s.FindAlertMessage().Text); Assert.Contains("App updated", s.FindAlertMessage().Text);
// View // View
@@ -2726,7 +2727,7 @@ namespace BTCPayServer.Tests
// Once more with items // Once more with items
s.GoToUrl(editUrl); s.GoToUrl(editUrl);
s.Driver.FindElement(By.Id("ShowItems")).Click(); s.Driver.FindElement(By.Id("ShowItems")).Click();
s.Driver.FindElement(By.Id("SaveSettings")).Click(); s.ClickPagePrimary();
Assert.Contains("App updated", s.FindAlertMessage().Text); Assert.Contains("App updated", s.FindAlertMessage().Text);
s.GoToUrl(keypadUrl); s.GoToUrl(keypadUrl);
@@ -2842,7 +2843,7 @@ namespace BTCPayServer.Tests
s.Driver.FindElement(By.Id("CustomTipPercentages")).SendKeys("10,21"); s.Driver.FindElement(By.Id("CustomTipPercentages")).SendKeys("10,21");
Assert.False(s.Driver.FindElement(By.Id("ShowDiscount")).Selected); Assert.False(s.Driver.FindElement(By.Id("ShowDiscount")).Selected);
s.Driver.FindElement(By.Id("ShowDiscount")).Click(); s.Driver.FindElement(By.Id("ShowDiscount")).Click();
s.Driver.FindElement(By.Id("SaveSettings")).Click(); s.ClickPagePrimary();
Assert.Contains("App updated", s.FindAlertMessage().Text); Assert.Contains("App updated", s.FindAlertMessage().Text);
// View // View
@@ -3008,7 +3009,7 @@ namespace BTCPayServer.Tests
// LNURL is true by default // LNURL is true by default
Assert.True(s.Driver.FindElement(By.Id("LNURLEnabled")).Selected); Assert.True(s.Driver.FindElement(By.Id("LNURLEnabled")).Selected);
s.Driver.SetCheckbox(By.Name("LUD12Enabled"), true); s.Driver.SetCheckbox(By.Name("LUD12Enabled"), true);
s.Driver.FindElement(By.Id("save")).Click(); s.ClickPagePrimary();
// Topup Invoice test // Topup Invoice test
var i = s.CreateInvoice(storeId, null, cryptoCode); var i = s.CreateInvoice(storeId, null, cryptoCode);
@@ -3094,7 +3095,7 @@ namespace BTCPayServer.Tests
s.GoToHome(); s.GoToHome();
s.GoToLightningSettings(); s.GoToLightningSettings();
s.Driver.SetCheckbox(By.Id("LNURLBech32Mode"), false); 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); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text);
// Ensure the toggles are set correctly // Ensure the toggles are set correctly
@@ -3112,7 +3113,7 @@ namespace BTCPayServer.Tests
s.AddLightningNode(LightningConnectionType.LndREST, false); s.AddLightningNode(LightningConnectionType.LndREST, false);
s.GoToLightningSettings(); s.GoToLightningSettings();
s.Driver.SetCheckbox(By.Id("LNURLEnabled"), true); 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); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text);
var invForPP = s.CreateInvoice(null, cryptoCode); var invForPP = s.CreateInvoice(null, cryptoCode);
s.GoToInvoiceCheckout(invForPP); s.GoToInvoiceCheckout(invForPP);
@@ -3132,7 +3133,7 @@ namespace BTCPayServer.Tests
currencyInput.Clear(); currencyInput.Clear();
currencyInput.SendKeys("BTC"); currencyInput.SendKeys("BTC");
s.Driver.FindElement(By.Id("Create")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.LinkText("View")).Click(); s.Driver.FindElement(By.LinkText("View")).Click();
s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last()); s.Driver.SwitchTo().Window(s.Driver.WindowHandles.Last());
var pullPaymentId = s.Driver.Url.Split('/').Last(); var pullPaymentId = s.Driver.Url.Split('/').Last();
@@ -3338,7 +3339,7 @@ namespace BTCPayServer.Tests
s.GoToHome(); s.GoToHome();
s.GoToProfile(ManageNavPages.LoginCodes); s.GoToProfile(ManageNavPages.LoginCodes);
var code = s.Driver.FindElement(By.Id("logincode")).GetAttribute("value"); 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")); Assert.NotEqual(code, s.Driver.FindElement(By.Id("logincode")).GetAttribute("value"));
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; int maxAttempts = 5;
retry: retry:
s.Driver.WaitForAndClick(By.Id("save")); s.ClickPagePrimary();
try try
{ {
Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text); Assert.Contains($"{cryptoCode} Lightning settings successfully updated", s.FindAlertMessage().Text);
@@ -3535,12 +3536,12 @@ retry:
s.FindAlertMessage(); s.FindAlertMessage();
s.GoToStore(StoreNavPages.Roles); s.GoToStore(StoreNavPages.Roles);
s.Driver.FindElement(By.Id("CreateRole")).Click(); s.ClickPagePrimary();
Assert.Contains("Create role", s.Driver.PageSource); 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("Role")).SendKeys("store role");
s.Driver.FindElement(By.Id("Save")).Click(); s.ClickPagePrimary();
s.FindAlertMessage(); s.FindAlertMessage();
existingStoreRoles = s.Driver.FindElement(By.CssSelector("table")).FindElements(By.CssSelector("tr")); 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)); Assert.DoesNotContain(options, element => element.Text.Equals("store role", StringComparison.InvariantCultureIgnoreCase));
s.GoToStore(StoreNavPages.Roles); s.GoToStore(StoreNavPages.Roles);
s.Driver.FindElement(By.Id("CreateRole")).Click(); s.ClickPagePrimary();
s.Driver.FindElement(By.Id("Role")).SendKeys("Malice"); 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.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(); s.FindAlertMessage();
Assert.Contains("Malice",s.Driver.PageSource); Assert.Contains("Malice",s.Driver.PageSource);
Assert.DoesNotContain(Policies.CanModifyServerSettings,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_Password")).SendKeys("mypassword");
s.Driver.FindElement(By.Id("Settings_From")).Clear(); s.Driver.FindElement(By.Id("Settings_From")).Clear();
s.Driver.FindElement(By.Id("Settings_From")).SendKeys("Firstname Lastname <email@example.com>"); s.Driver.FindElement(By.Id("Settings_From")).SendKeys("Firstname Lastname <email@example.com>");
s.Driver.FindElement(By.Id("Save")).SendKeys(Keys.Enter); s.ClickPagePrimary();
Assert.Contains("Configured", s.Driver.PageSource); Assert.Contains("Configured", s.Driver.PageSource);
s.Driver.FindElement(By.Id("Settings_Login")).Clear(); 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("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("Configured", s.Driver.PageSource);
Assert.Contains("test_fix", s.Driver.PageSource); Assert.Contains("test_fix", s.Driver.PageSource);
s.Driver.FindElement(By.Id("ResetPassword")).SendKeys(Keys.Enter); s.Driver.FindElement(By.Id("ResetPassword")).SendKeys(Keys.Enter);

View File

@@ -32,7 +32,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button id="Save" type="submit" class="btn btn-primary" name="command" value="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<div class="row"> <div class="row">

View File

@@ -29,7 +29,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<div> <div>
<button type="submit" class="btn btn-primary order-sm-1" id="SaveSettings">Save</button> <button id="page-primary" type="submit" class="btn btn-primary order-sm-1">Save</button>
@if (Model.Archived) @if (Model.Archived)
{ {
<button type="submit" class="btn btn-outline-secondary" name="Archived" value="False">Unarchive</button> <button type="submit" class="btn btn-outline-secondary" name="Archived" value="False">Unarchive</button>

View File

@@ -26,7 +26,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a class="btn btn-primary" role="button" id="CreateRole" asp-controller="@controller" asp-action="CreateOrEditRole" asp-route-role="create" asp-route-storeId="@storeId" permission="@permission">Add Role</a> <a id="page-primary" class="btn btn-primary" role="button" asp-controller="@controller" asp-action="CreateOrEditRole" asp-route-role="create" asp-route-storeId="@storeId" permission="@permission">Add Role</a>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -37,7 +37,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<div> <div>
<button type="submit" class="btn btn-primary order-sm-1" id="SaveSettings">Save</button> <button id="page-primary" type="submit" class="btn btn-primary order-sm-1">Save</button>
@if (Model.Archived) @if (Model.Archived)
{ {
<button type="submit" class="btn btn-outline-secondary" name="Archived" value="False">Unarchive</button> <button type="submit" class="btn btn-outline-secondary" name="Archived" value="False">Unarchive</button>

View File

@@ -8,4 +8,4 @@
} }
} }
<partial name="_Form" model="@Model.Form" /> <partial name="_Form" model="@Model.Form" />
<input type="submit" class="btn btn-primary" name="command" value="Submit" /> <input id="page-primary" type="submit" class="btn btn-primary" name="command" value="Submit" />

View File

@@ -1,4 +1,4 @@
@model BTCPayServer.Models.AccountViewModels.SetPasswordViewModel @model BTCPayServer.Models.AccountViewModels.SetPasswordViewModel
@{ @{
var cta = Model.HasPassword ? "Reset your password" : "Create Account"; var cta = Model.HasPassword ? "Reset your password" : "Create Account";
ViewData["Title"] = cta; ViewData["Title"] = cta;
@@ -39,5 +39,5 @@
<input asp-for="ConfirmPassword" class="form-control" /> <input asp-for="ConfirmPassword" class="form-control" />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span> <span asp-validation-for="ConfirmPassword" class="text-danger"></span>
</div> </div>
<button type="submit" class="btn btn-primary w-100 btn-lg" id="SetPassword">@cta</button> <button id="page-primary" type="submit" class="btn btn-primary w-100 btn-lg">@cta</button>
</form> </form>

View File

@@ -1,4 +1,4 @@
@model CreateAppViewModel @model CreateAppViewModel
@{ @{
ViewData.SetActivePage(AppsNavPages.Create, $"Create a new {Model.AppType ?? "app"}", Model.AppType); ViewData.SetActivePage(AppsNavPages.Create, $"Create a new {Model.AppType ?? "app"}", Model.AppType);
} }
@@ -10,7 +10,7 @@
<form asp-action="CreateApp" asp-route-appType="@Model.AppType"> <form asp-action="CreateApp" asp-route-appType="@Model.AppType">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<input type="submit" value="Create" class="btn btn-primary" id="Create" /> <input id="page-primary" type="submit" value="Create" class="btn btn-primary" />
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -41,7 +41,7 @@
</a> </a>
</small> </small>
</h2> </h2>
<a asp-action="CreateApp" asp-route-storeId="@Context.GetStoreData().Id" class="btn btn-primary" role="button" id="CreateNewApp">Create a new app</a> <a id="page-primary" asp-action="CreateApp" asp-route-storeId="@Context.GetStoreData().Id" class="btn btn-primary" role="button">Create a new app</a>
</div> </div>
<div class="table-responsive-md"> <div class="table-responsive-md">

View File

@@ -14,7 +14,7 @@
<vc:icon symbol="info" /> <vc:icon symbol="info" />
</a> </a>
</h2> </h2>
<a asp-action="Create" asp-route-storeId="@storeId" class="btn btn-primary mt-3 mt-sm-0" role="button" id="CreateForm" permission="@Policies.CanModifyStoreSettings"> <a id="page-primary" asp-action="Create" asp-route-storeId="@storeId" class="btn btn-primary mt-3 mt-sm-0" role="button" permission="@Policies.CanModifyStoreSettings">
Create Form Create Form
</a> </a>
</div> </div>

View File

@@ -208,7 +208,7 @@
</h2> </h2>
</nav> </nav>
<div> <div>
<button type="submit" class="btn btn-primary order-sm-1" id="SaveButton">Save</button> <button id="page-primary" type="submit" class="btn btn-primary order-sm-1">Save</button>
@if (!isNew) @if (!isNew)
{ {
<a class="btn btn-secondary" asp-action="ViewPublicForm" asp-route-formId="@formId" id="ViewForm">View</a> <a class="btn btn-secondary" asp-action="ViewPublicForm" asp-route-formId="@formId" id="ViewForm">View</a>

View File

@@ -38,7 +38,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<input type="submit" value="Create" class="btn btn-primary" id="Create" /> <input id="page-primary" type="submit" value="Create" class="btn btn-primary" />
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -107,7 +107,7 @@
<vc:icon symbol="info" /> <vc:icon symbol="info" />
</a> </a>
</h2> </h2>
<a id="CreateNewInvoice" <a id="page-primary"
permission="@Policies.CanCreateInvoice" permission="@Policies.CanCreateInvoice"
asp-action="CreateInvoice" asp-action="CreateInvoice"
asp-route-storeId="@Model.StoreId" asp-route-storeId="@Model.StoreId"

View File

@@ -27,7 +27,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a data-bs-toggle="collapse" data-bs-target="#AddAddress" class="btn btn-primary" role="button"> <a id="page-primary" data-bs-toggle="collapse" data-bs-target="#AddAddress" class="btn btn-primary" role="button">
Add Address Add Address
</a> </a>
</div> </div>

View File

@@ -18,7 +18,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button name="command" type="submit" class="btn btn-primary" value="Save" id="Save">Save</button> <button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -9,7 +9,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a class="btn btn-primary" asp-action="AddApiKey" id="AddApiKey"> <a id="page-primary" class="btn btn-primary" asp-action="AddApiKey">
Generate Key Generate Key
</a> </a>
</div> </div>

View File

@@ -36,7 +36,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button type="submit" class="btn btn-primary" id="Generate">Generate API Key</button> <button id="page-primary" type="submit" class="btn btn-primary">Generate API Key</button>
</div> </div>
<p>Generate a new api key to use BTCPay through its API.</p> <p>Generate a new api key to use BTCPay through its API.</p>
<div class="row"> <div class="row">

View File

@@ -1,4 +1,4 @@
@model ChangePasswordViewModel @model ChangePasswordViewModel
@{ @{
ViewData.SetActivePage(ManageNavPages.ChangePassword, "Change your password"); ViewData.SetActivePage(ManageNavPages.ChangePassword, "Change your password");
} }
@@ -6,7 +6,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary" id="UpdatePassword">Update Password</button> <button id="page-primary" type="submit" class="btn btn-primary">Update Password</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -11,7 +11,7 @@
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" id="save" class="btn btn-primary">Save</button> <button id="page-primary" type="submit" class="btn btn-primary">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="col-xxl-constrain col-xl-8"> <div class="col-xxl-constrain col-xl-8">

View File

@@ -5,7 +5,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a class="btn btn-primary" id="regeneratecode" asp-action="LoginCodes">Regenerate code</a> <a id="page-primary" class="btn btn-primary" asp-action="LoginCodes">Regenerate code</a>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<p>Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.</p> <p>Easily log into BTCPay Server on another device using a simple login code from an already authenticated device.</p>

View File

@@ -14,7 +14,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button type="submit" class="btn btn-primary" name="command" value="update">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="update">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -1,4 +1,4 @@
@model BTCPayServer.Models.ManageViewModels.SetPasswordViewModel @model BTCPayServer.Models.ManageViewModels.SetPasswordViewModel
@{ @{
ViewData.SetActivePage(ManageNavPages.ChangePassword, "Set your password"); ViewData.SetActivePage(ManageNavPages.ChangePassword, "Set your password");
} }
@@ -6,7 +6,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary">Set Password</button> <button id="page-primary" type="submit" class="btn btn-primary">Set Password</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -19,7 +19,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button name="command" type="submit" class="btn btn-primary" value="Save" id="Save">Save</button> <button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -35,11 +35,11 @@
<div> <div>
@if (string.IsNullOrEmpty(Model.Id)) @if (string.IsNullOrEmpty(Model.Id))
{ {
<button type="submit" class="btn btn-primary" id="SaveButton" permission="@Policies.CanModifyPaymentRequests">Create</button> <button id="page-primary" type="submit" class="btn btn-primary" permission="@Policies.CanModifyPaymentRequests">Create</button>
} }
else else
{ {
<button type="submit" class="btn btn-primary order-sm-1" id="SaveButton" permission="@Policies.CanModifyPaymentRequests">Save</button> <button id="page-primary" type="submit" class="btn btn-primary order-sm-1" permission="@Policies.CanModifyPaymentRequests">Save</button>
<a class="btn btn-secondary" asp-action="ViewPaymentRequest" asp-route-payReqId="@Model.Id" id="ViewPaymentRequest" target="_blank">View</a> <a class="btn btn-secondary" asp-action="ViewPaymentRequest" asp-route-payReqId="@Model.Id" id="ViewPaymentRequest" target="_blank">View</a>
} }
</div> </div>

View File

@@ -30,7 +30,7 @@
<vc:icon symbol="info" /> <vc:icon symbol="info" />
</a> </a>
</h2> </h2>
<a asp-action="EditPaymentRequest" asp-route-storeId="@storeId" class="btn btn-primary mt-3 mt-sm-0" role="button" id="CreatePaymentRequest" permission="@Policies.CanModifyPaymentRequests"> <a id="page-primary" asp-action="EditPaymentRequest" asp-route-storeId="@storeId" class="btn btn-primary mt-3 mt-sm-0" role="button" permission="@Policies.CanModifyPaymentRequests">
Create Request Create Request
</a> </a>
</div> </div>

View File

@@ -28,11 +28,11 @@
<div> <div>
@if (string.IsNullOrEmpty(Model.Id)) @if (string.IsNullOrEmpty(Model.Id))
{ {
<button type="submit" class="btn btn-primary" id="SaveButton">Create</button> <button id="page-primary" type="submit" class="btn btn-primary">Create</button>
} }
else else
{ {
<button type="submit" class="btn btn-primary order-sm-1" id="SaveButton">Save</button> <button id="page-primary" type="submit" class="btn btn-primary order-sm-1">Save</button>
<a class="btn btn-secondary" asp-action="ViewPullPayment" asp-route-pullPaymentId="@Model.Id" id="ViewPullPayment" target="_blank">View</a> <a class="btn btn-secondary" asp-action="ViewPullPayment" asp-route-pullPaymentId="@Model.Id" id="ViewPullPayment" target="_blank">View</a>
} }
</div> </div>

View File

@@ -28,7 +28,7 @@
</h2> </h2>
<div> <div>
<a cheat-mode="true" class="btn btn-outline-info text-nowrap" asp-action="StoreReports" asp-route-fakeData="true" asp-route-viewName="@Model.Request?.ViewName">Create fake data</a> <a cheat-mode="true" class="btn btn-outline-info text-nowrap" asp-action="StoreReports" asp-route-fakeData="true" asp-route-viewName="@Model.Request?.ViewName">Create fake data</a>
<button id="exportCSV" class="btn btn-primary text-nowrap" type="button">Export</button> <button id="page-primary" class="btn btn-primary text-nowrap" type="button">Export</button>
</div> </div>
</div> </div>
<div class="d-flex flex-column flex-sm-row align-items-center gap-3 mb-l"> <div class="d-flex flex-column flex-sm-row align-items-center gap-3 mb-l">

View File

@@ -1,4 +1,4 @@
@using BTCPayServer.Abstractions.Contracts @using BTCPayServer.Abstractions.Contracts
@using BTCPayServer.Services @using BTCPayServer.Services
@model BrandingViewModel; @model BrandingViewModel;
@inject IFileService FileService @inject IFileService FileService
@@ -16,7 +16,7 @@
<form method="post" enctype="multipart/form-data"> <form method="post" enctype="multipart/form-data">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary" name="command" value="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -16,7 +16,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<input type="submit" value="Create" class="btn btn-primary" id="Create" /> <input id="page-primary" type="submit" value="Create" class="btn btn-primary" />
</div> </div>
<div class="row"> <div class="row">

View File

@@ -7,7 +7,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary" name="command" value="Generate">Generate</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Generate">Generate</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -1,4 +1,4 @@
@model BTCPayServer.Controllers.RegisterFromAdminViewModel @model BTCPayServer.Controllers.RegisterFromAdminViewModel
@{ @{
ViewData.SetActivePage(ServerNavPages.Users, "Create account"); ViewData.SetActivePage(ServerNavPages.Users, "Create account");
} }
@@ -14,7 +14,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button id="Save" type="submit" class="btn btn-primary" name="command" value="Save">Create Account</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Create Account</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -1,4 +1,4 @@
@model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel @model BTCPayServer.Models.ServerViewModels.DynamicDnsViewModel
@{ @{
ViewData.SetActivePage(ServerNavPages.Services, "Dynamic DNS Service"); ViewData.SetActivePage(ServerNavPages.Services, "Dynamic DNS Service");
} }
@@ -31,7 +31,7 @@
</small> </small>
</h2> </h2>
</nav> </nav>
<button name="command" class="btn btn-primary" type="submit" value="Save">Save</button> <button id="page-primary" name="command" class="btn btn-primary" type="submit" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -22,7 +22,7 @@
</nav> </nav>
<div> <div>
<form method="post" asp-action="DynamicDnsService"> <form method="post" asp-action="DynamicDnsService">
<button id="AddDynamicDNS" class="btn btn-primary mt-2" type="submit">Add Service</button> <button id="page-primary" class="btn btn-primary mt-2" type="submit">Add Service</button>
</form> </form>
</div> </div>
</div> </div>

View File

@@ -16,7 +16,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button id="SaveButton" type="submit" class="btn btn-primary" name="command" value="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -1,4 +1,4 @@
@model ServerEmailsViewModel @model ServerEmailsViewModel
@{ @{
ViewData.SetActivePage(ServerNavPages.Emails, "Emails"); ViewData.SetActivePage(ServerNavPages.Emails, "Emails");
} }
@@ -6,7 +6,7 @@
<form method="post" autocomplete="off"> <form method="post" autocomplete="off">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary" name="command" value="Save" id="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="form-group mb-4"> <div class="form-group mb-4">

View File

@@ -7,7 +7,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a asp-action="CreateDictionary" class="btn btn-primary" role="button" id="CreateDictionary"> <a id="page-primary" asp-action="CreateDictionary" class="btn btn-primary" role="button">
Create Create
</a> </a>
</div> </div>

View File

@@ -15,7 +15,7 @@
} }
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a asp-action="CreateUser" class="btn btn-primary" role="button" id="CreateUser"> <a id="page-primary" asp-action="CreateUser" class="btn btn-primary" role="button">
Add User Add User
</a> </a>
</div> </div>

View File

@@ -21,7 +21,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button id="SaveButton" type="submit" class="btn btn-primary" name="command" value="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -14,7 +14,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button type="submit" class="btn btn-primary" name="command" value="Save">Next</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Next</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -1,4 +1,4 @@
@using BTCPayServer.Abstractions.Contracts @using BTCPayServer.Abstractions.Contracts
@using Microsoft.AspNetCore.Mvc.TagHelpers @using Microsoft.AspNetCore.Mvc.TagHelpers
@model UsersViewModel.UserViewModel @model UsersViewModel.UserViewModel
@inject IFileService FileService @inject IFileService FileService
@@ -18,7 +18,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<button name="command" type="submit" class="btn btn-primary" value="Save" id="SaveUser">Save</button> <button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="form-group"> <div class="form-group">

View File

@@ -26,7 +26,7 @@
</ol> </ol>
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
</nav> </nav>
<input type="submit" value="Create" class="btn btn-primary" id="Create"/> <input id="page-primary" type="submit" value="Create" class="btn btn-primary"/>
</div> </div>
<partial name="_StatusMessage"/> <partial name="_StatusMessage"/>

View File

@@ -60,7 +60,7 @@
<form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings"> <form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary" id="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -1,4 +1,4 @@
@model CreateTokenViewModel @model CreateTokenViewModel
@{ @{
var store = Context.GetStoreData(); var store = Context.GetStoreData();
ViewData.SetActivePage(StoreNavPages.Tokens, "Create New Token", store?.Id); ViewData.SetActivePage(StoreNavPages.Tokens, "Create New Token", store?.Id);
@@ -24,7 +24,7 @@
{ {
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
} }
<input id="RequestPairing" type="submit" value="Request Pairing" class="btn btn-primary" /> <input id="page-primary" type="submit" value="Request Pairing" class="btn btn-primary" />
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -12,7 +12,7 @@
<form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings"> <form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header"> <div class="sticky-header">
<h2>Store Settings</h2> <h2>Store Settings</h2>
<button type="submit" class="btn btn-primary" id="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -9,7 +9,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button id="save" name="command" type="submit" value="save" class="btn btn-primary">Save</button> <button id="page-primary" name="command" type="submit" value="save" class="btn btn-primary">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -26,11 +26,11 @@
</nav> </nav>
@if (Model.IsNew) @if (Model.IsNew)
{ {
<button name="add" type="submit" class="btn btn-primary" value="New" id="New">Add Webhook</button> <button id="page-primary" name="add" type="submit" class="btn btn-primary" value="New">Add Webhook</button>
} }
else else
{ {
<button name="update" type="submit" class="btn btn-primary" value="Save" id="Save">Update Webhook</button> <button id="page-primary" name="update" type="submit" class="btn btn-primary" value="Save" >Update Webhook</button>
} }
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />

View File

@@ -10,7 +10,7 @@
<form method="post" permissioned="@Policies.CanModifyStoreSettings"> <form method="post" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button name="command" type="submit" class="btn btn-primary" value="Save">Save</button> <button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -1,4 +1,4 @@
@using BTCPayServer.Abstractions.TagHelpers @using BTCPayServer.Abstractions.TagHelpers
@using BTCPayServer.Client @using BTCPayServer.Client
@using Microsoft.AspNetCore.Mvc.TagHelpers @using Microsoft.AspNetCore.Mvc.TagHelpers
@model PairingModel @model PairingModel
@@ -37,7 +37,7 @@
{ {
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
} }
<button id="ApprovePairing" type="submit" class="btn btn-primary mt-3" title="Approve this pairing demand">Approve</button> <button id="page-primary" type="submit" class="btn btn-primary mt-3" title="Approve this pairing demand">Approve</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -185,7 +185,7 @@
</div> </div>
<div class="text-start mt-4"> <div class="text-start mt-4">
<button id="save" name="command" type="submit" value="save" class="btn btn-primary me-2">Save</button> <button id="page-primary" name="command" type="submit" value="save" class="btn btn-primary me-2">Save</button>
</div> </div>
</form> </form>

View File

@@ -10,7 +10,7 @@
<form method="post" autocomplete="off" permissioned="@Policies.CanModifyStoreSettings"> <form method="post" autocomplete="off" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header"> <div class="sticky-header">
<h2>Email Server</h2> <h2>Email Server</h2>
<button type="submit" class="btn btn-primary" name="command" value="Save" id="Save">Save</button> <button id="page-primary" type="submit" class="btn btn-primary" name="command" value="Save">Save</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
@if (Model.IsFallbackSetup()) @if (Model.IsFallbackSetup())

View File

@@ -7,7 +7,7 @@
<form method="post"> <form method="post">
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<button type="submit" class="btn btn-primary mt-3">Send test webhook</button> <button id="page-primary" type="submit" class="btn btn-primary mt-3">Send test webhook</button>
</div> </div>
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">

View File

@@ -9,7 +9,7 @@
<div class="sticky-header"> <div class="sticky-header">
<h2>@ViewData["Title"]</h2> <h2>@ViewData["Title"]</h2>
<a id="CreateWebhook" asp-action="NewWebhook" class="btn btn-primary" role="button" asp-route-storeId="@Context.GetRouteValue("storeId")" permission="@Policies.CanModifyStoreSettings"> <a id="page-primary" asp-action="NewWebhook" class="btn btn-primary" role="button" asp-route-storeId="@Context.GetRouteValue("storeId")" permission="@Policies.CanModifyStoreSettings">
Create Webhook Create Webhook
</a> </a>
</div> </div>