Converting Tests back to C# but still with Playwright

This commit is contained in:
2026-06-03 14:45:18 -04:00
parent 85834466f1
commit 46150d3a69
209 changed files with 1503 additions and 683 deletions
+28
View File
@@ -0,0 +1,28 @@
using Tests.Helpers;
namespace Tests.Pages;
public abstract class BasePage
{
protected Website Website { get; }
protected BasePage(Website website)
{
Website = website;
}
public abstract string Url { get; }
public virtual async Task GotoAsync()
{
await Website.GotoAsync(Url);
}
public async Task<List<string>> GetLinksAsync()
{
var content = Website.FindById("content");
var links = content.Locator("a");
var hrefs = await links.EvaluateAllAsync<string[]>("els => els.map(el => el.getAttribute('href')).filter(Boolean)");
return hrefs.ToList();
}
}