Code cleanup

This commit is contained in:
2026-05-27 10:51:19 -04:00
parent 5e486b0edb
commit 2423d232cf
48 changed files with 53731 additions and 46250 deletions
+5 -7
View File
@@ -1,4 +1,3 @@
using System.Linq;
using OpenQA.Selenium;
namespace AOW4.SeleniumTests.Pages;
@@ -15,13 +14,12 @@ public class NavMenuPage
public void ClickLinkByText(string linkText)
{
var link = _driver.FindElements(By.CssSelector("a[href]"))
.FirstOrDefault(e => !string.IsNullOrWhiteSpace(e.Text) && e.Text.Trim().Equals(linkText, System.StringComparison.OrdinalIgnoreCase));
.FirstOrDefault(e =>
!string.IsNullOrWhiteSpace(e.Text) &&
e.Text.Trim().Equals(linkText, StringComparison.OrdinalIgnoreCase));
if (link == null)
{
throw new NoSuchElementException($"Link with text '{linkText}' not found in the page.");
}
if (link == null) throw new NoSuchElementException($"Link with text '{linkText}' not found in the page.");
link.Click();
}
}
}