From 7b64224482fcecfbfade634b72c1e077bd373150 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 20:04:43 +0000 Subject: [PATCH 1/8] WIP #273 - Add config to the test web app This means that we can request longer delays, which is useful when dealing with a remote web driver. --- .../Controllers/DelayedOpeningController.cs | 6 +++--- .../Views/DelayedOpening/Index.cshtml | 2 +- .../wwwroot/DelayedNavigation.html | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Tests/CSF.Screenplay.Selenium.TestWebapp/Controllers/DelayedOpeningController.cs b/Tests/CSF.Screenplay.Selenium.TestWebapp/Controllers/DelayedOpeningController.cs index 4453e94f..f877f04c 100644 --- a/Tests/CSF.Screenplay.Selenium.TestWebapp/Controllers/DelayedOpeningController.cs +++ b/Tests/CSF.Screenplay.Selenium.TestWebapp/Controllers/DelayedOpeningController.cs @@ -5,9 +5,9 @@ public class DelayedOpeningController : Controller { [HttpGet, Route("DelayedOpening")] - public async Task Index() + public async Task Index(int delaySeconds = 2) { - await Task.Delay(TimeSpan.FromSeconds(2)); - return View(); + await Task.Delay(TimeSpan.FromSeconds(delaySeconds)); + return View(delaySeconds); } } \ No newline at end of file diff --git a/Tests/CSF.Screenplay.Selenium.TestWebapp/Views/DelayedOpening/Index.cshtml b/Tests/CSF.Screenplay.Selenium.TestWebapp/Views/DelayedOpening/Index.cshtml index d7710b8f..6123f15e 100644 --- a/Tests/CSF.Screenplay.Selenium.TestWebapp/Views/DelayedOpening/Index.cshtml +++ b/Tests/CSF.Screenplay.Selenium.TestWebapp/Views/DelayedOpening/Index.cshtml @@ -4,7 +4,7 @@

Delayed navigation landing

- This is the page which takes 2 seconds to load. + This is the page which takes @Model second(s) to load.

You're finally here!

diff --git a/Tests/CSF.Screenplay.Selenium.TestWebapp/wwwroot/DelayedNavigation.html b/Tests/CSF.Screenplay.Selenium.TestWebapp/wwwroot/DelayedNavigation.html index c878b7c1..f3606a38 100644 --- a/Tests/CSF.Screenplay.Selenium.TestWebapp/wwwroot/DelayedNavigation.html +++ b/Tests/CSF.Screenplay.Selenium.TestWebapp/wwwroot/DelayedNavigation.html @@ -6,6 +6,14 @@

Delayed navigation

Click the link below to trigger navigation to a page which takes a few moments before it becomes available.

- Click me + + Click me + \ No newline at end of file From 6337126c1a092102cd2c16a9ac9628de9a88ce0f Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 20:34:42 +0000 Subject: [PATCH 2/8] Resolve #273 - Improve wait tests This means that when using a remote web driver, the delays will be longer and there will be a greater difference between the duration waited and the threshold for an error. This will avoid the tests "passing by accident" or "failing by accident" due to latency involved in using a remote web driver. --- .../Actions/WaitTests.cs | 77 ++++++++++--------- .../ClickAndWaitForDocumentReadyTests.cs | 9 ++- 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs index db9b43b6..1e3a679f 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs @@ -2,6 +2,8 @@ using System; using CSF.Screenplay.Performables; using CSF.Screenplay.Selenium.Elements; +using OpenQA.Selenium; +using OpenQA.Selenium.Remote; using static CSF.Screenplay.PerformanceStarter; using static CSF.Screenplay.Selenium.PerformableBuilder; @@ -18,21 +20,28 @@ static readonly ITarget static readonly NamedUri testPage = new NamedUri("WaitTests.html", "the test page"); + static int GetDelayMilliseconds(Actor actor) + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 1500 : 250; + + static int GetSufficientWaitMilliseconds(Actor actor) + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 2000 : 600; + + static int GetInsufficientWaitMilliseconds(Actor actor) => 50; + [Test, Screenplay] public async Task WaitingForSufficientTimeShouldSucceed(IStage stage) { var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and 250ms has elapsed")) - .ForAtMost(TimeSpan.FromMilliseconds(500)) - .WithPollingInterval(TimeSpan.FromMilliseconds(150)) + .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) ); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } [Test, Screenplay] @@ -41,16 +50,15 @@ public async Task WaitingForSufficientTimeWithIgnoredExceptionsShouldSucceed(ISt var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text("250")) - .ForAtMost(TimeSpan.FromMilliseconds(500)) - .WithPollingInterval(TimeSpan.FromMilliseconds(50)) + await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text(GetDelayMilliseconds(webster).ToString())) + .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) .IgnoringTheseExceptionTypes(typeof(TargetNotFoundException)) ); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } [Test, Screenplay] @@ -59,16 +67,15 @@ public async Task WaitingForSufficientTimeWithoutIgnoredExceptionsShouldSucceed( var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text("250")) - .ForAtMost(TimeSpan.FromMilliseconds(500)) - .WithPollingInterval(TimeSpan.FromMilliseconds(50)) + await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text(GetDelayMilliseconds(webster).ToString())) + .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) // No ignored exceptions specified here, but the default behaviour will ignore TargetNotFoundException ); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } [Test, Screenplay] @@ -77,11 +84,10 @@ public async Task WaitingForSufficientTimeWithEmptyIgnoredExceptionsShouldThrow( var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - Assert.That(async () => await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text("250")) - .ForAtMost(TimeSpan.FromMilliseconds(500)) - .WithPollingInterval(TimeSpan.FromMilliseconds(50)) + Assert.That(async () => await Then(webster).Should(WaitUntil(displayTextSpan.Has().Text(GetDelayMilliseconds(webster).ToString())) + .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) .IgnoringTheseExceptionTypes() // Explicitly empty ), Throws.InstanceOf()); } @@ -92,40 +98,41 @@ public async Task WaitingForInsufficientTimeShouldThrow(IStage stage) var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("2000").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - Assert.That(async () => await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and 2000ms has elapsed")).ForAtMost(TimeSpan.FromMilliseconds(500))), - Throws.InstanceOf().And.InnerException.TypeOf()); + Assert.That(async () => await Then(webster).Should(WaitUntil(displayText.Has().Text($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")) + .ForAtMost(TimeSpan.FromMilliseconds(GetInsufficientWaitMilliseconds(webster)))), + Throws.InstanceOf().And.InnerException.TypeOf()); } [Test, Screenplay] public async Task WaitingForSufficientTimeUsingDefaultWaitAbilityShouldSucceed(IStage stage) { var webster = stage.Spotlight(); - webster.IsAbleTo(new UseADefaultWaitTime(TimeSpan.FromMilliseconds(500))); + webster.IsAbleTo(new UseADefaultWaitTime(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster)))); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and 250ms has elapsed"))); + await Then(webster).Should(WaitUntil(displayText.Has().Text($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed"))); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } [Test, Screenplay] public async Task WaitingForInsufficientTimeUsingDefaultWaitAbilityShouldThrow(IStage stage) { var webster = stage.Spotlight(); - webster.IsAbleTo(new UseADefaultWaitTime(TimeSpan.FromMilliseconds(100))); + webster.IsAbleTo(new UseADefaultWaitTime(TimeSpan.FromMilliseconds(GetInsufficientWaitMilliseconds(webster)))); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("2000").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - Assert.That(async () => await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and 2000ms has elapsed"))), - Throws.InstanceOf().And.InnerException.TypeOf()); + Assert.That(async () => await Then(webster).Should(WaitUntil(displayText.Has().Text($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed"))), + Throws.InstanceOf().And.InnerException.TypeOf()); } [Test, Screenplay] @@ -134,12 +141,12 @@ public async Task WaitingForSufficientTimeWithoutAPredicateShouldSucceed(IStage var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitFor(TimeSpan.FromMilliseconds(300))); + await Then(webster).Should(WaitFor(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster)))); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } [Test, Screenplay] @@ -148,11 +155,11 @@ public async Task WaitingForInsufficientTimeWithoutAPredicateShouldYieldIncorrec var webster = stage.Spotlight(); await Given(webster).WasAbleTo(OpenTheUrl(testPage)); - await Given(webster).WasAbleTo(EnterTheText("250").Into(delayTimer)); + await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitFor(TimeSpan.FromMilliseconds(10))); + await Then(webster).Should(WaitFor(TimeSpan.FromMilliseconds(GetInsufficientWaitMilliseconds(webster)))); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); - Assert.That(contents, Is.Not.EqualTo("Clicked, and 250ms has elapsed")); + Assert.That(contents, Is.Not.EqualTo($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")); } } \ No newline at end of file diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs index 907afe03..b59bf1dc 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using CSF.Screenplay.Performables; using CSF.Screenplay.Selenium.Elements; using OpenQA.Selenium; @@ -15,6 +16,8 @@ static readonly ITarget link = new ElementId("clickable"), displayText = new ElementId("textContent"); + static readonly string[] ignoredBrowsers = ["chrome", "edge"]; + [Test, Screenplay] public async Task PerformAsAsyncShouldWaitSoItCanGetTheAppropriateContent(IStage stage) { @@ -33,12 +36,12 @@ public async Task PerformAsAsyncShouldThrowIfWeDontWaitLongEnough(IStage stage) var webster = stage.Spotlight(); var ability = webster.GetAbility(); - if(ability.DriverOptions.BrowserName == "chrome") - Assert.Pass("This test cannot meaningfully be run on a Chrome browser, because it always waits for the page load; treating as an implicit pass"); + if(ignoredBrowsers.Contains(ability.DriverOptions.BrowserName)) + Assert.Pass("This test cannot meaningfully be run on a Chrome or Edge browser, because they always wait for the page load. Treating this test as an implicit pass."); await Given(webster).WasAbleTo(OpenTheUrl(startPage)); - Assert.That(async () => await When(webster).AttemptsTo(ClickOn(link).AndWaitForANewPageToLoad(TimeSpan.FromMilliseconds(200))), + Assert.That(async () => await When(webster).AttemptsTo(ClickOn(link).AndWaitForANewPageToLoad(TimeSpan.FromMilliseconds(100))), Throws.InstanceOf().And.InnerException.InstanceOf()); } } \ No newline at end of file From 1a9884d673f568398df62473bec322e8835596ca Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 20:55:53 +0000 Subject: [PATCH 3/8] Correct an omission --- Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs index 1e3a679f..49066766 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs @@ -36,7 +36,7 @@ public async Task WaitingForSufficientTimeShouldSucceed(IStage stage) await Given(webster).WasAbleTo(OpenTheUrl(testPage)); await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and 250ms has elapsed")) + await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")) .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) ); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); From f9ce8e915b3bab8f6aedacb549d25041500687d7 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 21:00:47 +0000 Subject: [PATCH 4/8] Oops, fix a typo --- Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs index 49066766..c9ca2efa 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs @@ -36,7 +36,7 @@ public async Task WaitingForSufficientTimeShouldSucceed(IStage stage) await Given(webster).WasAbleTo(OpenTheUrl(testPage)); await Given(webster).WasAbleTo(EnterTheText(GetDelayMilliseconds(webster).ToString()).Into(delayTimer)); await When(webster).AttemptsTo(ClickOn(clickableButton)); - await Then(webster).Should(WaitUntil(displayText.Has().Text("Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")) + await Then(webster).Should(WaitUntil(displayText.Has().Text($"Clicked, and {GetDelayMilliseconds(webster)}ms has elapsed")) .ForAtMost(TimeSpan.FromMilliseconds(GetSufficientWaitMilliseconds(webster))) ); var contents = await Then(webster).Should(ReadFromTheElement(displayText).TheText()); From adb9f429f0df6041275f78815d3c90f398c05529 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 22:03:08 +0000 Subject: [PATCH 5/8] Correct the fix for #274 I looked the name up at https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/Edge/EdgeOptions.cs --- .../Tasks/ClickAndWaitForDocumentReadyTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs index b59bf1dc..f11f401f 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Tasks/ClickAndWaitForDocumentReadyTests.cs @@ -16,7 +16,7 @@ static readonly ITarget link = new ElementId("clickable"), displayText = new ElementId("textContent"); - static readonly string[] ignoredBrowsers = ["chrome", "edge"]; + static readonly string[] ignoredBrowsers = ["chrome", "MicrosoftEdge"]; [Test, Screenplay] public async Task PerformAsAsyncShouldWaitSoItCanGetTheAppropriateContent(IStage stage) From 933a123b82ad58bcaeef032d433958eaee115196 Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 22:10:44 +0000 Subject: [PATCH 6/8] Perhaps resolves a wait issue in remote Safari & Firefox --- .../Tasks/ClickAndWaitForDocumentReady.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CSF.Screenplay.Selenium/Tasks/ClickAndWaitForDocumentReady.cs b/CSF.Screenplay.Selenium/Tasks/ClickAndWaitForDocumentReady.cs index 385f48f2..69aaf007 100644 --- a/CSF.Screenplay.Selenium/Tasks/ClickAndWaitForDocumentReady.cs +++ b/CSF.Screenplay.Selenium/Tasks/ClickAndWaitForDocumentReady.cs @@ -24,9 +24,6 @@ public class ClickAndWaitForDocumentReady : ISingleElementPerformable const string COMPLETE_READY_STATE = "complete"; static readonly NamedScriptWithResult getReadyState = Scripts.GetTheDocumentReadyState; - static readonly TimeSpan - pollingInterval = TimeSpan.FromMilliseconds(100), - stalenessTimeout = TimeSpan.FromMilliseconds(500); readonly TimeSpan waitTimeout; @@ -39,11 +36,10 @@ public async ValueTask PerformAsAsync(ICanPerform actor, IWebDriver webDriver, L { await actor.PerformAsync(ClickOn(element.Value), cancellationToken); await actor.PerformAsync(WaitUntil(ElementIsStale(element.Value.WebElement)) - .ForAtMost(stalenessTimeout) - .WithPollingInterval(pollingInterval) + .ForAtMost(waitTimeout) .Named($"{element.Value.Name} is no longer on the page"), cancellationToken); - await actor.PerformAsync(WaitUntil(PageIsReady).ForAtMost(waitTimeout).Named("the page is ready").WithPollingInterval(pollingInterval), + await actor.PerformAsync(WaitUntil(PageIsReady).ForAtMost(waitTimeout).Named("the page is ready"), cancellationToken); } From 62f38e2266a5dc6b8432c074fbb939b194b8caca Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 22:36:43 +0000 Subject: [PATCH 7/8] Attempt to fix waits in CI --- Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs index c9ca2efa..b65b8c25 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs @@ -21,10 +21,10 @@ static readonly ITarget static readonly NamedUri testPage = new NamedUri("WaitTests.html", "the test page"); static int GetDelayMilliseconds(Actor actor) - => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 1500 : 250; + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 5000 : 500; static int GetSufficientWaitMilliseconds(Actor actor) - => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 2000 : 600; + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 9000 : 1000; static int GetInsufficientWaitMilliseconds(Actor actor) => 50; From a01b9c20430a7b9494e14c30c1f5da7c0414243e Mon Sep 17 00:00:00 2001 From: Craig Fowler Date: Wed, 28 Jan 2026 22:56:09 +0000 Subject: [PATCH 8/8] Bump the waits further --- Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs index b65b8c25..7f5cc899 100644 --- a/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs +++ b/Tests/CSF.Screenplay.Selenium.Tests/Actions/WaitTests.cs @@ -21,12 +21,12 @@ static readonly ITarget static readonly NamedUri testPage = new NamedUri("WaitTests.html", "the test page"); static int GetDelayMilliseconds(Actor actor) - => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 5000 : 500; + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 5000 : 2000; static int GetSufficientWaitMilliseconds(Actor actor) - => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 9000 : 1000; + => actor.GetAbility().WebDriver.Unproxy() is RemoteWebDriver ? 9000 : 4000; - static int GetInsufficientWaitMilliseconds(Actor actor) => 50; + static int GetInsufficientWaitMilliseconds(Actor actor) => 500; [Test, Screenplay] public async Task WaitingForSufficientTimeShouldSucceed(IStage stage)