mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Make tests more resilient
This commit is contained in:
parent
430a9eb261
commit
529c2df1cc
2 changed files with 9 additions and 9 deletions
|
@ -5,7 +5,7 @@
|
|||
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">$(TargetFrameworkOverride)</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<NoWarn>NU1701,CA1816,CA1308,CA1810,CA2208</NoWarn>
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<LangVersion>8.0</LangVersion>
|
||||
<UserSecretsId>AB0AC1DD-9D26-485B-9416-56A33F268117</UserSecretsId>
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -72,16 +72,16 @@ namespace BTCPayServer.Tests
|
|||
|
||||
internal void AssertHappyMessage()
|
||||
{
|
||||
try
|
||||
using var cts = new CancellationTokenSource(10_000);
|
||||
while (!cts.IsCancellationRequested)
|
||||
{
|
||||
Assert.Single(Driver.FindElements(By.ClassName("alert-success")).Where(el => el.Displayed));
|
||||
}
|
||||
catch (Xunit.Sdk.SingleException)
|
||||
{
|
||||
Logs.Tester.LogInformation("Should have shown happy message, but instead got");
|
||||
Logs.Tester.LogInformation(this.Driver.PageSource);
|
||||
throw;
|
||||
var success = Driver.FindElements(By.ClassName("alert-success")).Where(el => el.Displayed).Any();
|
||||
if (success)
|
||||
return;
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
Logs.Tester.LogInformation(this.Driver.PageSource);
|
||||
Assert.True(false, "Should have shown happy message");
|
||||
}
|
||||
|
||||
public static readonly TimeSpan ImplicitWait = TimeSpan.FromSeconds(10);
|
||||
|
|
Loading…
Add table
Reference in a new issue