From 67b4d69e2bce9fc7d49d8224a99f09dd3a10c5bb Mon Sep 17 00:00:00 2001 From: Philip Woulfe Date: Thu, 9 Jul 2026 18:38:37 +0000 Subject: [PATCH] #268 fix e2e bug --- tests/F1.E2E.Tests/Pages/HomePage.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/F1.E2E.Tests/Pages/HomePage.cs b/tests/F1.E2E.Tests/Pages/HomePage.cs index c465f67..edd4e6c 100644 --- a/tests/F1.E2E.Tests/Pages/HomePage.cs +++ b/tests/F1.E2E.Tests/Pages/HomePage.cs @@ -6,6 +6,22 @@ namespace F1.E2E.Tests.Pages; internal class HomePage { + private static readonly string[] AuthenticatedNavigationSelectors = + [ + "a[href='results']", + "a[href='/results']", + "a[href='drivers']", + "a[href='/drivers']", + "a[href='selection']", + "a[href='/selection']", + "a[href^='selection/']", + "a[href^='/selection/']", + "a[href='admin']", + "a[href='/admin']", + "a[href='admin/migration-runs']", + "a[href='/admin/migration-runs']" + ]; + private readonly IWebDriver _driver; private readonly WebDriverWait _wait; private readonly string _baseUrl; @@ -32,7 +48,7 @@ public void WaitForAuthenticatedNavigation() PageReadiness.WaitForAppReady( _driver, _wait.Timeout, - driver => driver.FindElements(By.CssSelector("a[href^='selection/']")).Count > 0); + driver => AuthenticatedNavigationSelectors.Any(selector => driver.FindElements(By.CssSelector(selector)).Count > 0)); _trace("Authenticated navigation link rendered."); }