From 6468b391215f71ade4aee2e41c80c4a36af4cf0f Mon Sep 17 00:00:00 2001 From: Kukks Date: Wed, 25 Mar 2020 07:59:30 +0100 Subject: [PATCH] try fix test again --- BTCPayServer.Tests/SeleniumTests.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/BTCPayServer.Tests/SeleniumTests.cs b/BTCPayServer.Tests/SeleniumTests.cs index 34d943666..60ad24853 100644 --- a/BTCPayServer.Tests/SeleniumTests.cs +++ b/BTCPayServer.Tests/SeleniumTests.cs @@ -12,6 +12,8 @@ using System.Text.RegularExpressions; using BTCPayServer.Models; using NBitcoin.Payment; using BTCPayServer.Controllers; +using BTCPayServer.Data; +using BTCPayServer.Services.Wallets; namespace BTCPayServer.Tests { @@ -442,6 +444,17 @@ namespace BTCPayServer.Tests var targetTx = await s.Server.ExplorerNode.SendToAddressAsync(address, Money.Coins(1.2m)); var tx = await s.Server.ExplorerNode.GetRawTransactionAsync(targetTx); var spentOutpoint = new OutPoint(targetTx, tx.Outputs.FindIndex(txout => txout.Value == Money.Coins(1.2m))); + await TestUtils.EventuallyAsync(async () => + { + var store = await s.Server.PayTester.StoreRepository.FindStore(storeId); + var x = store.GetSupportedPaymentMethods(s.Server.NetworkProvider) + .OfType() + .Single(settings => settings.PaymentId.CryptoCode == walletId.CryptoCode); + Assert.Contains( + await s.Server.PayTester.GetService().GetWallet(walletId.CryptoCode) + .GetUnspentCoins(x.AccountDerivation), + coin => coin.OutPoint == spentOutpoint); + }); await s.Server.ExplorerNode.GenerateAsync(1); s.GoToWalletSend(walletId); s.Driver.FindElement(By.Id("advancedSettings")).Click(); @@ -451,7 +464,7 @@ namespace BTCPayServer.Tests var el = s.Driver.FindElement(By.Id(spentOutpoint.ToString())); s.Driver.FindElement(By.Id(spentOutpoint.ToString())).Click(); var inputSelectionSelect = s.Driver.FindElement(By.Name("SelectedInputs")); - Assert.Equal(1, inputSelectionSelect.FindElements(By.CssSelector("[selected]")).Count); + Assert.Single(inputSelectionSelect.FindElements(By.CssSelector("[selected]"))); var bob = new Key().PubKey.Hash.GetAddress(Network.RegTest); SetTransactionOutput(s, 0, bob, 0.3m);