diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index 5900ad77a..50131ad81 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -70,6 +70,11 @@ namespace BTCPayServer.Tests Driver.AssertNoError(); } + internal void AssertHappyMessage() + { + Assert.Single(Driver.FindElements(By.ClassName("alert-success")).Where(el => el.Displayed)); + } + public static readonly TimeSpan ImplicitWait = TimeSpan.FromSeconds(10); public string Link(string relativeLink) { @@ -110,8 +115,7 @@ namespace BTCPayServer.Tests Driver.FindElement(By.ClassName("store-derivation-scheme")).SendKeys(derivationScheme); Driver.FindElement(By.Id("Continue")).ForceClick(); Driver.FindElement(By.Id("Confirm")).ForceClick(); - Driver.FindElement(By.Id("Save")).ForceClick(); - return; + AssertHappyMessage(); } public void AddLightningNode(string cryptoCode, LightningConnectionType connectionType) diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 80c7a3988..e6b2c23da 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -46,6 +46,7 @@ namespace BTCPayServer.Tests Assert.Contains(passEl.Text, "hellorockstar", StringComparison.OrdinalIgnoreCase); s.Driver.FindElement(By.Id("delete")).Click(); s.Driver.FindElement(By.Id("continue")).Click(); + s.AssertHappyMessage(); seedEl = s.Driver.FindElement(By.Id("SeedTextArea")); Assert.Contains("Seed removed", seedEl.Text, StringComparison.OrdinalIgnoreCase); @@ -219,6 +220,7 @@ namespace BTCPayServer.Tests s.ClickOnAllSideMenus(); s.GoToInvoices(); s.CreateInvoice(store); + s.AssertHappyMessage(); s.Driver.FindElement(By.ClassName("invoice-details-link")).Click(); var invoiceUrl = s.Driver.Url; @@ -280,10 +282,10 @@ namespace BTCPayServer.Tests s.Driver.FindElement(By.Id("Tokens")).Click(); s.Driver.FindElement(By.Id("CreateNewToken")).Click(); s.Driver.FindElement(By.Id("RequestPairing")).Click(); - string pairingCode = AssertUrlHasPairingCode(s); s.Driver.FindElement(By.Id("ApprovePairing")).Click(); + s.AssertHappyMessage(); Assert.Contains(pairingCode, s.Driver.PageSource); var client = new NBitpayClient.Bitpay(new Key(), s.Server.PayTester.ServerUri); diff --git a/BTCPayServer/Views/Stores/RequestPairing.cshtml b/BTCPayServer/Views/Stores/RequestPairing.cshtml index d4eafab1d..c59b3f272 100644 --- a/BTCPayServer/Views/Stores/RequestPairing.cshtml +++ b/BTCPayServer/Views/Stores/RequestPairing.cshtml @@ -38,7 +38,7 @@ - +