namespace Tests.Pages.BuildCalculator; public class BuildChartComponent { private readonly Website _website; public BuildChartComponent(Website website) => _website = website; public ILocator ChartsContainer => _website.Locator(".chartsContainer"); public ILocator DisplayValue(string label) => _website.Locator(".displayContainer").Filter(new() { HasText = label }).Locator(".displayContent"); public async Task GetHighestAlloyAsync() => (await DisplayValue("Highest Alloy").TextContentAsync())?.Trim() ?? ""; public async Task GetHighestEtherAsync() => (await DisplayValue("Highest Ether").TextContentAsync())?.Trim() ?? ""; public async Task GetHighestPyreAsync() => (await DisplayValue("Highest Pyre").TextContentAsync())?.Trim() ?? ""; public async Task GetHighestArmyAsync() => (await DisplayValue("Highest Army").TextContentAsync())?.Trim() ?? ""; public async Task GetChartCountAsync() => await ChartsContainer.Locator("> div").CountAsync(); }