22 lines
437 B
C#
22 lines
437 B
C#
using Microsoft.Playwright;
|
|
|
|
namespace Tests.PageObjects;
|
|
|
|
public abstract class BasePage
|
|
{
|
|
protected readonly IPage Page;
|
|
protected readonly string BaseUrl = "http://localhost:5256";
|
|
|
|
protected BasePage(IPage page)
|
|
{
|
|
Page = page;
|
|
}
|
|
|
|
public async Task NavigateToAsync(string path)
|
|
{
|
|
await Page.GotoAsync($"{BaseUrl}{path}");
|
|
}
|
|
|
|
public ILocator GetHeading() => Page.Locator("h1");
|
|
}
|