Files
ChronoCCG/Chrono/Tests/PlaywrightTests.cs
T
2026-06-25 09:45:21 -04:00

42 lines
1.3 KiB
C#

using Microsoft.Playwright;
using Microsoft.Playwright.NUnit;
namespace Tests;
[Parallelizable(ParallelScope.Self)]
[TestFixture]
public class PlaywrightTests : PageTest
{
private const string BaseUrl = "http://localhost:5256";
[Test]
public async Task HomePage_ShouldLoad()
{
await Page.GotoAsync(BaseUrl);
await Expect(Page).ToHaveTitleAsync(new System.Text.RegularExpressions.Regex("Chrono CCG"));
// Check for some content that should be on the home page
var heading = Page.Locator("h1");
await Expect(heading).ToBeVisibleAsync();
await Expect(heading).ToContainTextAsync("Slop Game Reference - Chrono CCG");
}
[Test]
public async Task DocsPage_ShouldLoad()
{
await Page.GotoAsync($"{BaseUrl}/docs");
var heading = Page.Locator("h1");
await Expect(heading).ToBeVisibleAsync();
await Expect(heading).ToContainTextAsync("Documentation");
}
[Test]
public async Task AgentsPage_ShouldLoad()
{
await Page.GotoAsync($"{BaseUrl}/agents");
// Agents page uses Telerik Grid, let's wait for it
await Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
var grid = Page.Locator(".agents-grid");
await Expect(grid).ToBeVisibleAsync();
}
}