28 lines
1.5 KiB
C#
28 lines
1.5 KiB
C#
namespace Tests.Pages.BuildCalculator;
|
|
|
|
public class BankComponent
|
|
{
|
|
private readonly 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 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> GetWorkerCountAsync() =>
|
|
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(0).TextContentAsync())?.Trim() ?? "";
|
|
|
|
public async Task<string> GetBusyWorkerCountAsync() =>
|
|
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(1).TextContentAsync())?.Trim() ?? "";
|
|
|
|
public async Task<string> GetCreatingWorkerCountAsync() =>
|
|
(await BankContainer.Locator(".workerText").Locator(".displayContent").Nth(2).TextContentAsync())?.Trim() ?? "";
|
|
}
|