Agent Tests for API, MAUI, and Slop Features
This commit is contained in:
@@ -3,18 +3,42 @@ namespace Tests.Pages.BuildCalculator;
|
||||
public class BuildChartComponent
|
||||
{
|
||||
private readonly Website _website;
|
||||
public BuildChartComponent(Website website) => _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 ILocator DisplayValue(string label)
|
||||
{
|
||||
return _website.Locator(".displayContainer").Filter(new LocatorFilterOptions { HasText = label })
|
||||
.Locator(".displayContent");
|
||||
}
|
||||
|
||||
public async Task<string> GetHighestAlloyAsync() => (await DisplayValue("Highest Alloy").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetHighestEtherAsync() => (await DisplayValue("Highest Ether").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetHighestPyreAsync() => (await DisplayValue("Highest Pyre").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetHighestArmyAsync() => (await DisplayValue("Highest Army").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetHighestAlloyAsync()
|
||||
{
|
||||
return (await DisplayValue("Highest Alloy").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<int> GetChartCountAsync() =>
|
||||
await ChartsContainer.Locator("> div").CountAsync();
|
||||
}
|
||||
public async Task<string> GetHighestEtherAsync()
|
||||
{
|
||||
return (await DisplayValue("Highest Ether").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetHighestPyreAsync()
|
||||
{
|
||||
return (await DisplayValue("Highest Pyre").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetHighestArmyAsync()
|
||||
{
|
||||
return (await DisplayValue("Highest Army").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<int> GetChartCountAsync()
|
||||
{
|
||||
return await ChartsContainer.Locator("> div").CountAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user