Skip to content

Commit

Permalink
Making EnteringInteractiveModeShouldWait more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
Piedone committed Jan 12, 2025
1 parent 2db3a83 commit 7e2ce01
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Lombiq.Tests.UI.Samples/Tests/InteractiveModeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Helpers;
using OpenQA.Selenium;
using Shouldly;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -57,9 +59,11 @@ await Task.WhenAll(
Task.Run(
async () =>
{
// Ensure that the interactive mode polls for status at least once, so the arbitrary waiting
// actually works in a real testing scenario.
await Task.Delay(5000, context.Configuration.TestCancellationToken);
ReliabilityHelper.DoWithRetriesOrFail(
() => context.Driver.WindowHandles.Count > 1,
TimeSpan.FromSeconds(5));

context.SwitchToLastWindow();

await context.ClickReliablyOnAsync(By.ClassName("interactive__continue"));
},
Expand Down

0 comments on commit 7e2ce01

Please sign in to comment.