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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 185 additions and 173 deletions

View file

@ -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<HttpRequestException>(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}");

View file

@ -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:

View file

@ -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();

View file

@ -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"));
}
}
}
}

View file

@ -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<UserManager<ApplicationUser>>();
@ -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 <email@example.com>");
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);

View file

@ -32,7 +32,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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 class="row">

View file

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

View file

@ -26,7 +26,7 @@
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -37,7 +37,7 @@
<div class="sticky-header">
<h2>@ViewData["Title"]</h2>
<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)
{
<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" />
<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";
ViewData["Title"] = cta;
@ -39,5 +39,5 @@
<input asp-for="ConfirmPassword" class="form-control" />
<span asp-validation-for="ConfirmPassword" class="text-danger"></span>
</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>

View file

@ -1,4 +1,4 @@
@model CreateAppViewModel
@model CreateAppViewModel
@{
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">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -41,7 +41,7 @@
</a>
</small>
</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 class="table-responsive-md">

View file

@ -14,7 +14,7 @@
<vc:icon symbol="info" />
</a>
</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
</a>
</div>

View file

@ -208,7 +208,7 @@
</h2>
</nav>
<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)
{
<a class="btn btn-secondary" asp-action="ViewPublicForm" asp-route-formId="@formId" id="ViewForm">View</a>

View file

@ -38,7 +38,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<partial name="_StatusMessage" />

View file

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

View file

@ -27,7 +27,7 @@
<div class="sticky-header">
<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
</a>
</div>

View file

@ -17,8 +17,8 @@
<li class="breadcrumb-item active" aria-current="page">@ViewData["Title"]</li>
</ol>
<h2>@ViewData["Title"]</h2>
</nav>
<button name="command" type="submit" class="btn btn-primary" value="Save" id="Save">Save</button>
</nav>
<button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -9,7 +9,7 @@
<div class="sticky-header">
<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
</a>
</div>

View file

@ -36,7 +36,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<p>Generate a new api key to use BTCPay through its API.</p>
<div class="row">

View file

@ -1,4 +1,4 @@
@model ChangePasswordViewModel
@model ChangePasswordViewModel
@{
ViewData.SetActivePage(ManageNavPages.ChangePassword, "Change your password");
}
@ -6,7 +6,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -11,7 +11,7 @@
<form method="post" enctype="multipart/form-data">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="col-xxl-constrain col-xl-8">

View file

@ -5,7 +5,7 @@
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<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>
<h2>@ViewData["Title"]</h2>
</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>
<partial name="_StatusMessage" />
<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");
}
@ -6,7 +6,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

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

View file

@ -35,11 +35,11 @@
<div>
@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
{
<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>
}
</div>

View file

@ -30,7 +30,7 @@
<vc:icon symbol="info" />
</a>
</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
</a>
</div>

View file

@ -28,11 +28,11 @@
<div>
@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
{
<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>
}
</div>

View file

@ -28,7 +28,7 @@
</h2>
<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>
<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 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
@model BrandingViewModel;
@inject IFileService FileService
@ -16,7 +16,7 @@
<form method="post" enctype="multipart/form-data">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -16,7 +16,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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 class="row">

View file

@ -7,7 +7,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -1,4 +1,4 @@
@model BTCPayServer.Controllers.RegisterFromAdminViewModel
@model BTCPayServer.Controllers.RegisterFromAdminViewModel
@{
ViewData.SetActivePage(ServerNavPages.Users, "Create account");
}
@ -14,7 +14,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<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");
}
@ -31,7 +31,7 @@
</small>
</h2>
</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>
<partial name="_StatusMessage" />

View file

@ -22,7 +22,7 @@
</nav>
<div>
<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>
</div>
</div>

View file

@ -16,7 +16,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<partial name="_StatusMessage" />

View file

@ -1,4 +1,4 @@
@model ServerEmailsViewModel
@model ServerEmailsViewModel
@{
ViewData.SetActivePage(ServerNavPages.Emails, "Emails");
}
@ -6,7 +6,7 @@
<form method="post" autocomplete="off">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="form-group mb-4">

View file

@ -7,7 +7,7 @@
<div class="sticky-header">
<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
</a>
</div>

View file

@ -15,7 +15,7 @@
}
<div class="sticky-header">
<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
</a>
</div>

View file

@ -21,7 +21,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -14,7 +14,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<partial name="_StatusMessage" />

View file

@ -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 @@
<li class="breadcrumb-item active" aria-current="page">User</li>
</ol>
<h2>@ViewData["Title"]</h2>
</nav>
<button name="command" type="submit" class="btn btn-primary" value="Save" id="SaveUser">Save</button>
</nav>
<button id="page-primary" name="command" type="submit" class="btn btn-primary" value="Save">Save</button>
</div>
<partial name="_StatusMessage" />
<div class="form-group">

View file

@ -26,7 +26,7 @@
</ol>
<h2>@ViewData["Title"]</h2>
</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>
<partial name="_StatusMessage"/>

View file

@ -60,7 +60,7 @@
<form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -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 @@
{
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -12,7 +12,7 @@
<form method="post" enctype="multipart/form-data" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />

View file

@ -9,7 +9,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -26,11 +26,11 @@
</nav>
@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
{
<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>
<partial name="_StatusMessage" />

View file

@ -10,7 +10,7 @@
<form method="post" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -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 @@
{
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -185,7 +185,7 @@
</div>
<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>
</form>

View file

@ -10,7 +10,7 @@
<form method="post" autocomplete="off" permissioned="@Policies.CanModifyStoreSettings">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
@if (Model.IsFallbackSetup())

View file

@ -7,7 +7,7 @@
<form method="post">
<div class="sticky-header">
<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>
<partial name="_StatusMessage" />
<div class="row">

View file

@ -9,7 +9,7 @@
<div class="sticky-header">
<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
</a>
</div>