30 lines
876 B
C#
30 lines
876 B
C#
using Microsoft.Playwright;
|
|
|
|
namespace Tests.PageObjects;
|
|
|
|
public class LoginPage : BasePage
|
|
{
|
|
public LoginPage(IPage page) : base(page)
|
|
{
|
|
}
|
|
|
|
public ILocator EnrollButton =>
|
|
Page.GetByRole(AriaRole.Button, new PageGetByRoleOptions { Name = "Enroll Passkey" });
|
|
|
|
public ILocator SignInButton =>
|
|
Page.GetByRole(AriaRole.Button, new PageGetByRoleOptions { Name = "Sign in with Passkey" });
|
|
|
|
public ILocator ErrorMessage => Page.Locator(".alert-danger");
|
|
|
|
public async Task GotoAsync()
|
|
{
|
|
await NavigateToAsync("/login");
|
|
}
|
|
|
|
public async Task WaitForInteractiveAsync()
|
|
{
|
|
await Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
|
|
// Wait for Blazor circuit: either button must be visible
|
|
await Page.WaitForSelectorAsync("button", new PageWaitForSelectorOptions { Timeout = 10_000 });
|
|
}
|
|
} |