Agent Tests for API, MAUI, and Slop Features
This commit is contained in:
@@ -3,25 +3,60 @@ namespace Tests.Pages.BuildCalculator;
|
||||
public class BankComponent
|
||||
{
|
||||
private readonly Website _website;
|
||||
public BankComponent(Website website) => _website = website;
|
||||
|
||||
public BankComponent(Website website)
|
||||
{
|
||||
_website = website;
|
||||
}
|
||||
|
||||
public ILocator BankContainer => _website.Locator(".bankContainer");
|
||||
|
||||
public ILocator DisplayValue(string label) =>
|
||||
BankContainer.Locator(".displayContainer").Filter(new() { HasText = label }).Locator(".displayContent");
|
||||
public ILocator DisplayValue(string label)
|
||||
{
|
||||
return BankContainer.Locator(".displayContainer").Filter(new LocatorFilterOptions { HasText = label })
|
||||
.Locator(".displayContent");
|
||||
}
|
||||
|
||||
public async Task<string> GetTimeAsync() => (await DisplayValue("Time").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetAlloyAsync() => (await DisplayValue("Alloy").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetEtherAsync() => (await DisplayValue("Ether").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetPyreAsync() => (await DisplayValue("Pyre").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetSupplyAsync() => (await DisplayValue("Supply").TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetTimeAsync()
|
||||
{
|
||||
return (await DisplayValue("Time").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetWorkerCountAsync() =>
|
||||
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(0).TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetAlloyAsync()
|
||||
{
|
||||
return (await DisplayValue("Alloy").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetBusyWorkerCountAsync() =>
|
||||
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(1).TextContentAsync())?.Trim() ?? "";
|
||||
public async Task<string> GetEtherAsync()
|
||||
{
|
||||
return (await DisplayValue("Ether").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetCreatingWorkerCountAsync() =>
|
||||
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(2).TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
public async Task<string> GetPyreAsync()
|
||||
{
|
||||
return (await DisplayValue("Pyre").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetSupplyAsync()
|
||||
{
|
||||
return (await DisplayValue("Supply").TextContentAsync())?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetWorkerCountAsync()
|
||||
{
|
||||
return (await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(0).TextContentAsync())
|
||||
?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetBusyWorkerCountAsync()
|
||||
{
|
||||
return (await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(1).TextContentAsync())
|
||||
?.Trim() ?? "";
|
||||
}
|
||||
|
||||
public async Task<string> GetCreatingWorkerCountAsync()
|
||||
{
|
||||
return (await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(2).TextContentAsync())
|
||||
?.Trim() ?? "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user