Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
using LANCommander.Server.UI.Tests.Pages;
|
|
|
|
|
using Microsoft.Playwright;
|
2026-03-08 12:33:49 +11:00
|
|
|
using Xunit.Abstractions;
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
|
|
|
|
|
namespace LANCommander.Server.UI.Tests.Tests;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Tests for navigating around key parts of the admin application.
|
|
|
|
|
/// These tests verify that the main admin pages are accessible and render correctly
|
|
|
|
|
/// after logging in as an administrator.
|
2026-06-23 17:51:34 -05:00
|
|
|
/// Uses the shared "Server" collection fixture so the server starts once for the whole collection.
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
/// </summary>
|
2026-03-07 17:12:12 +11:00
|
|
|
[Collection("Server")]
|
|
|
|
|
public class AdminNavigationTests : IAsyncLifetime
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
{
|
|
|
|
|
private readonly ConfiguredServerFixture _fixture;
|
2026-03-08 12:33:49 +11:00
|
|
|
private readonly ITestOutputHelper _output;
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
private IBrowserContext _context = null!;
|
|
|
|
|
private IPage _page = null!;
|
|
|
|
|
|
2026-03-08 12:33:49 +11:00
|
|
|
public AdminNavigationTests(ConfiguredServerFixture fixture, ITestOutputHelper output)
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
{
|
|
|
|
|
_fixture = fixture;
|
2026-03-08 12:33:49 +11:00
|
|
|
_output = output;
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task InitializeAsync()
|
|
|
|
|
{
|
|
|
|
|
(_context, _page) = await _fixture.CreateLoggedInPageAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task DisposeAsync()
|
|
|
|
|
{
|
2026-06-23 17:51:34 -05:00
|
|
|
await ScreenshotHelper.CaptureAsync(_page, _output);
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
if (_page != null) await _page.CloseAsync();
|
|
|
|
|
if (_context != null) await _context.DisposeAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task Dashboard_ShowsOverviewWithCharts()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
Assert.True(await dashboard.IsDisplayedAsync());
|
|
|
|
|
|
|
|
|
|
// Dashboard should show playtime charts
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("Top 10 Total Playtime (By Player)")).ToBeVisibleAsync();
|
|
|
|
|
await Assertions.Expect(_page.GetByText("Top 10 Total Playtime (By Game)")).ToBeVisibleAsync();
|
|
|
|
|
await Assertions.Expect(_page.GetByText("Top Average Session Length (By Game)")).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task Navigation_SidebarShowsExpectedMenuItems()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
var menuItems = await dashboard.GetMainMenuItemsAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Dashboards"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Games"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Redistributables"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Tools"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Servers"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Issues"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Files"));
|
|
|
|
|
Assert.Contains(menuItems, m => m.Contains("Settings"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task GamesPage_ShowsEmptyTable()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToGamesAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Games", _page.Url);
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("Games").First).ToBeVisibleAsync();
|
|
|
|
|
await Assertions.Expect(_page.GetByRole(AriaRole.Button, new() { Name = "Add Game" })).ToBeVisibleAsync();
|
|
|
|
|
await Assertions.Expect(_page.GetByRole(AriaRole.Button, new() { Name = "Import" })).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
// Empty table should show "No data"
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("No data")).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task RedistributablesPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToRedistributablesAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Redistributables", _page.Url);
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("Redistributables").First).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task ToolsPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToToolsAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Tools", _page.Url);
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("Tools").First).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task ServersPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToServersAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Servers", _page.Url);
|
2026-06-23 17:51:34 -05:00
|
|
|
await Assertions.Expect(_page.GetByText("Servers").First).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task IssuesPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToIssuesAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Issues", _page.Url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task FilesPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToFilesAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Files", _page.Url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public async Task SettingsGeneralPage_IsAccessible()
|
|
|
|
|
{
|
|
|
|
|
var dashboard = new AdminDashboardPage(_page);
|
|
|
|
|
await dashboard.NavigateToSettingsGeneralAsync();
|
|
|
|
|
|
|
|
|
|
Assert.Contains("/Settings/General", _page.Url);
|
2026-06-23 22:11:05 -05:00
|
|
|
// Verify settings-specific content is visible ("Use SSL" is unique to General settings)
|
|
|
|
|
await Assertions.Expect(_page.GetByText("Use SSL")).ToBeVisibleAsync();
|
Spike: Playwright UI automated tests for server application
Add LANCommander.Server.UI.Tests project with 19 Playwright-based UI tests
covering three key scenarios:
- First-time setup flow (4 tests): Fresh server redirect, setup wizard steps,
database provider selection, and complete wizard-to-login flow
- Login flow (5 tests): Unauthenticated redirect, page elements, valid/invalid
credentials, and empty credential handling
- Admin navigation (10 tests): Dashboard, sidebar menu, Games, Redistributables,
Tools, Servers, Issues, Files, Settings pages, and Settings submenu items
Infrastructure includes:
- ServerManager: Manages server process lifecycle with data directory backup/restore
- PlaywrightFixture: Browser lifecycle management (headless Chromium)
- ConfiguredServerFixture: Shared xUnit class fixture for tests needing a
configured server (avoids restarting server per test)
- Page objects: LoginPage, FirstTimeSetupPage, AdminDashboardPage
Key technical decisions:
- Uses IClassFixture<T> pattern to share server instances across test classes
- Disables parallel execution (tests share port 1337)
- Uses element-based waits instead of URL-based waits for Blazor SSR reliability
- Uses role-based selectors for AntDesign components (no standard label/for)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-28 14:16:01 +11:00
|
|
|
}
|
|
|
|
|
}
|