Converting Tests back to C# but still with Playwright
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
namespace Tests.Shared;
|
||||
|
||||
public class SearchDialog
|
||||
{
|
||||
private readonly Website _website;
|
||||
public SearchDialog(Website website) => _website = website;
|
||||
|
||||
public ILocator SearchBackground => _website.FindById("searchBackground");
|
||||
public ILocator SearchInput => _website.FindById("searchInput");
|
||||
|
||||
public async Task CloseDialogAsync()
|
||||
{
|
||||
await _website.ClickElementAsync(SearchBackground);
|
||||
}
|
||||
|
||||
public async Task<SearchDialog> SearchAsync(string text)
|
||||
{
|
||||
await _website.EnterInputAsync(SearchInput, text);
|
||||
return this;
|
||||
}
|
||||
|
||||
public async Task SelectSearchEntityAsync(string label)
|
||||
{
|
||||
await _website.ClickElementAsync(_website.Locator($"button[label=\"{label}\"]"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user