Agent Tests for API, MAUI, and Slop Features
This commit is contained in:
@@ -3,13 +3,11 @@ namespace Tests.Pages.BuildCalculator;
|
||||
public class OptionsComponent
|
||||
{
|
||||
private readonly Website _website;
|
||||
public OptionsComponent(Website website) => _website = website;
|
||||
|
||||
private ILocator FormNumberInput(string label) =>
|
||||
_website.Locator(".formNumberContainer").Filter(new() { HasText = label }).Locator("input[type='number']");
|
||||
|
||||
private ILocator ButtonWithLabel(string label) =>
|
||||
_website.Locator("button").Filter(new() { HasText = label });
|
||||
public OptionsComponent(Website website)
|
||||
{
|
||||
_website = website;
|
||||
}
|
||||
|
||||
public ILocator BuildingInputDelayInput => FormNumberInput("Building Input Delay");
|
||||
public ILocator WaitTimeInput => FormNumberInput("Wait Time");
|
||||
@@ -17,22 +15,55 @@ public class OptionsComponent
|
||||
public ILocator AddWaitButton => ButtonWithLabel("Add Wait").First;
|
||||
public ILocator AddWaitToButton => ButtonWithLabel("Add Wait").Last;
|
||||
|
||||
private ILocator FormNumberInput(string label)
|
||||
{
|
||||
return _website.Locator(".formNumberContainer").Filter(new LocatorFilterOptions { HasText = label })
|
||||
.Locator("input[type='number']");
|
||||
}
|
||||
|
||||
private ILocator ButtonWithLabel(string label)
|
||||
{
|
||||
return _website.Locator("button").Filter(new LocatorFilterOptions { HasText = label });
|
||||
}
|
||||
|
||||
public async Task SetBuildingInputDelayAsync(int value)
|
||||
{
|
||||
await BuildingInputDelayInput.FillAsync(value.ToString());
|
||||
await BuildingInputDelayInput.PressAsync("Enter");
|
||||
}
|
||||
|
||||
public async Task SetWaitTimeAsync(int value) =>
|
||||
public async Task SetWaitTimeAsync(int value)
|
||||
{
|
||||
await WaitTimeInput.FillAsync(value.ToString());
|
||||
}
|
||||
|
||||
public async Task SetWaitToAsync(int value) =>
|
||||
public async Task SetWaitToAsync(int value)
|
||||
{
|
||||
await WaitToInput.FillAsync(value.ToString());
|
||||
}
|
||||
|
||||
public async Task ClickAddWaitAsync() => await AddWaitButton.ClickAsync();
|
||||
public async Task ClickAddWaitToAsync() => await AddWaitToButton.ClickAsync();
|
||||
public async Task ClickAddWaitAsync()
|
||||
{
|
||||
await AddWaitButton.ClickAsync();
|
||||
}
|
||||
|
||||
public async Task<string> GetBuildingInputDelayAsync() => await BuildingInputDelayInput.InputValueAsync();
|
||||
public async Task<string> GetWaitTimeAsync() => await WaitTimeInput.InputValueAsync();
|
||||
public async Task<string> GetWaitToAsync() => await WaitToInput.InputValueAsync();
|
||||
}
|
||||
public async Task ClickAddWaitToAsync()
|
||||
{
|
||||
await AddWaitToButton.ClickAsync();
|
||||
}
|
||||
|
||||
public async Task<string> GetBuildingInputDelayAsync()
|
||||
{
|
||||
return await BuildingInputDelayInput.InputValueAsync();
|
||||
}
|
||||
|
||||
public async Task<string> GetWaitTimeAsync()
|
||||
{
|
||||
return await WaitTimeInput.InputValueAsync();
|
||||
}
|
||||
|
||||
public async Task<string> GetWaitToAsync()
|
||||
{
|
||||
return await WaitToInput.InputValueAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user