35 lines
928 B
C#
35 lines
928 B
C#
using Microsoft.Playwright;
|
|
|
|
namespace Tests.PageObjects;
|
|
|
|
public class DecksPage : BasePage
|
|
{
|
|
public DecksPage(IPage page) : base(page)
|
|
{
|
|
}
|
|
|
|
public ILocator DeckCards => Page.Locator(".deck-card");
|
|
public ILocator CreateDeckButton => Page.Locator(".btn-create-deck");
|
|
|
|
public async Task GotoAsync()
|
|
{
|
|
await NavigateToAsync("/decks");
|
|
}
|
|
|
|
public async Task WaitForInteractiveAsync()
|
|
{
|
|
await Page.WaitForLoadStateAsync(LoadState.DOMContentLoaded);
|
|
await Page.WaitForSelectorAsync(".deck-card", new PageWaitForSelectorOptions { Timeout = 15_000 });
|
|
}
|
|
|
|
public async Task ClickCreateDeckAsync()
|
|
{
|
|
await CreateDeckButton.ClickAsync();
|
|
}
|
|
|
|
public async Task ClickDeckByNameAsync(string name)
|
|
{
|
|
await Page.Locator(".deck-card-title").GetByText(name, new LocatorGetByTextOptions { Exact = true })
|
|
.ClickAsync();
|
|
}
|
|
} |