Files
scadalink-design/tests/ScadaLink.CentralUI.PlaywrightTests/NavigationTests.cs
Joseph Doherty b07f43a308 feat(centralui): rebrand web UI to ScadaBridge + technical-light theme
Rename the user-facing product name from ScadaLink to ScadaBridge across
the six display strings (browser title, sidebar brand, login + not-authorized
headings, dashboard welcome/subtitle). Namespaces, assemblies, config keys,
and _content/ScadaLink.CentralUI asset routes are unchanged.

Apply the technical-light design system: vendor theme.css + IBM Plex fonts
into the CentralUI RCL, include theme.css globally (after Bootstrap so its
--bs-* token overrides win), and restyle the layout chrome to a light
sidebar — white surface, hairline rules, ink text, accent-blue active item,
the brand accent mark. Page markup stays Bootstrap and inherits the warm
paper background, Plex type, accent, and hairline borders via the tokens.

Tests: build 0 warnings; bUnit 542 passed; Playwright 64 passed.
2026-05-22 07:03:46 -04:00

88 lines
3.3 KiB
C#

using Microsoft.Playwright;
namespace ScadaLink.CentralUI.PlaywrightTests;
[Collection("Playwright")]
public class NavigationTests
{
private readonly PlaywrightFixture _fixture;
public NavigationTests(PlaywrightFixture fixture)
{
_fixture = fixture;
}
[Fact]
public async Task Dashboard_IsVisibleAfterLogin()
{
var page = await _fixture.NewAuthenticatedPageAsync();
// The nav sidebar should be visible with the brand. ToContainText, not
// ToHaveText: the brand also carries the accent mark glyph (▮).
await Expect(page.Locator(".brand")).ToContainTextAsync("ScadaBridge");
// The nav should contain "Dashboard" link (exact match to avoid "Health Dashboard")
await Expect(page.GetByRole(AriaRole.Link, new() { Name = "Dashboard", Exact = true })).ToBeVisibleAsync();
}
[Theory]
[InlineData("Sites", "/admin/sites")]
[InlineData("API Keys", "/admin/api-keys")]
[InlineData("LDAP Mappings", "/admin/ldap-mappings")]
public async Task AdminNavLinks_NavigateCorrectly(string linkText, string expectedPath)
{
var page = await _fixture.NewAuthenticatedPageAsync();
await ClickNavAndWait(page, linkText, expectedPath);
}
[Theory]
[InlineData("SMTP Configuration", "/notifications/smtp")]
[InlineData("Notification Lists", "/notifications/lists")]
[InlineData("Notification Report", "/notifications/report")]
[InlineData("Notification KPIs", "/notifications/kpis")]
public async Task NotificationsNavLinks_NavigateCorrectly(string linkText, string expectedPath)
{
var page = await _fixture.NewAuthenticatedPageAsync();
await ClickNavAndWait(page, linkText, expectedPath);
}
[Theory]
[InlineData("Templates", "/design/templates")]
[InlineData("Shared Scripts", "/design/shared-scripts")]
[InlineData("Connections", "/design/connections")]
[InlineData("External Systems", "/design/external-systems")]
public async Task DesignNavLinks_NavigateCorrectly(string linkText, string expectedPath)
{
var page = await _fixture.NewAuthenticatedPageAsync();
await ClickNavAndWait(page, linkText, expectedPath);
}
[Theory]
[InlineData("Topology", "/deployment/topology")]
[InlineData("Deployments", "/deployment/deployments")]
public async Task DeploymentNavLinks_NavigateCorrectly(string linkText, string expectedPath)
{
var page = await _fixture.NewAuthenticatedPageAsync();
await ClickNavAndWait(page, linkText, expectedPath);
}
[Theory]
[InlineData("Health Dashboard", "/monitoring/health")]
[InlineData("Event Logs", "/monitoring/event-logs")]
[InlineData("Parked Messages", "/monitoring/parked-messages")]
public async Task MonitoringNavLinks_NavigateCorrectly(string linkText, string expectedPath)
{
var page = await _fixture.NewAuthenticatedPageAsync();
await ClickNavAndWait(page, linkText, expectedPath);
}
private static async Task ClickNavAndWait(IPage page, string linkText, string expectedPath)
{
await page.Locator($"nav a:has-text('{linkText}')").ClickAsync();
await PlaywrightFixture.WaitForPathAsync(page, expectedPath);
Assert.Contains(expectedPath, page.Url);
}
private static ILocatorAssertions Expect(ILocator locator) =>
Assertions.Expect(locator);
}