From 4d5b2c40338f9e2e5df75950b8933c763ebdcbd5 Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Tue, 23 Feb 2021 16:57:21 +0100 Subject: [PATCH] Make Selenium test more robust Fixes an issue similar to what we fixed in #2293. --- BTCPayServer.Tests/SeleniumTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 2bd6c6587..ab7da72a1 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -711,8 +711,9 @@ namespace BTCPayServer.Tests Logs.Tester.LogInformation("Let's see if we can delete store with some webhooks inside"); s.GoToStore(storeId); - s.Driver.ExecuteJavaScript("window.scrollBy(0,1000);"); - s.Driver.FindElement(By.Id("danger-zone-expander")).Click(); + // Open danger zone 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. + s.Driver.ExecuteJavaScript("document.getElementById('danger-zone').classList.add('show')"); s.Driver.FindElement(By.Id("delete-store")).Click(); s.Driver.FindElement(By.Id("continue")).Click(); s.FindAlertMessage();