diff --git a/BTCPayServer.Tests/SeleniumTester.cs b/BTCPayServer.Tests/SeleniumTester.cs index da45b2c8b..eac0c855e 100644 --- a/BTCPayServer.Tests/SeleniumTester.cs +++ b/BTCPayServer.Tests/SeleniumTester.cs @@ -17,6 +17,7 @@ using Microsoft.Extensions.Configuration; using NBitcoin; using OpenQA.Selenium; using OpenQA.Selenium.Chrome; +using OpenQA.Selenium.Support.Extensions; using Xunit; namespace BTCPayServer.Tests @@ -47,9 +48,7 @@ namespace BTCPayServer.Tests var runInBrowser = config["RunSeleniumInBrowser"] == "true"; // Reset this using `dotnet user-secrets remove RunSeleniumInBrowser` - - var chromeDriverPath = config["ChromeDriverDirectory"] ?? - (Server.PayTester.InContainer ? "/usr/bin" : Directory.GetCurrentDirectory()); + var chromeDriverPath = config["ChromeDriverDirectory"] ?? (Server.PayTester.InContainer ? "/usr/bin" : Directory.GetCurrentDirectory()); var options = new ChromeOptions(); if (Server.PayTester.InContainer) @@ -149,18 +148,13 @@ namespace BTCPayServer.Tests Driver.FindElement(By.Id("ScriptPubKeyType")).Click(); Driver.FindElement(By.CssSelector($"#ScriptPubKeyType option[value={format}]")).Click(); - Driver.FindElement(By.Id("AdvancedSettingsButton")).Click(); - Driver.SetCheckbox(By.Id("ImportKeysToRPC"), importkeys); - Driver.FindElement(By.Id("AdvancedSettingsButton")).Click(); // close again - try - { - Driver.FindElement(By.Id("Continue")).Click(); - } - catch (ElementClickInterceptedException) - { - Driver.WaitForAndClick(By.Id("Continue")); - } + // Open advanced settings via JS, because if we click the link it triggers the toggle animation. + // This leads to Selenium trying to click the button while it is moving resulting in an error. + Driver.ExecuteJavaScript("document.getElementById('AdvancedSettings').classList.add('show')"); + + Driver.SetCheckbox(By.Id("ImportKeysToRPC"), importkeys); + Driver.FindElement(By.Id("Continue")).Click(); // Seed backup page FindAlertMessage(); diff --git a/BTCPayServer/Views/Stores/_GenerateWalletForm.cshtml b/BTCPayServer/Views/Stores/_GenerateWalletForm.cshtml index 6d65ac330..0dd203dd3 100644 --- a/BTCPayServer/Views/Stores/_GenerateWalletForm.cshtml +++ b/BTCPayServer/Views/Stores/_GenerateWalletForm.cshtml @@ -58,10 +58,10 @@ }
- -
+
@if (isImport) // hide account option when creating a wallet {