test(e2e): unify toast assertion + extract shared PlaywrightDbConnection (review cleanups)

This commit is contained in:
Joseph Doherty
2026-06-05 11:00:27 -04:00
parent 5546c32593
commit 667d141f1a
5 changed files with 49 additions and 51 deletions
@@ -1,4 +1,5 @@
using Microsoft.Data.SqlClient;
using ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Cluster;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Notifications;
@@ -30,23 +31,11 @@ namespace ZB.MOM.WW.ScadaBridge.CentralUI.PlaywrightTests.Notifications;
/// </summary>
internal static class NotificationDataSeeder
{
private const string DefaultConnectionString =
"Server=localhost,1433;Database=ScadaBridgeConfig;User Id=scadabridge_app;Password=ScadaBridge_Dev1#;TrustServerCertificate=true;Encrypt=false;Connect Timeout=5";
private const string EnvVar = "SCADABRIDGE_PLAYWRIGHT_DB";
/// <summary>
/// Connection string for the running cluster's configuration DB. Resolved from
/// <c>SCADABRIDGE_PLAYWRIGHT_DB</c> when set, otherwise the local docker dev defaults.
/// Connection string for the running cluster's configuration DB.
/// Delegates to <see cref="PlaywrightDbConnection.ConnectionString"/>.
/// </summary>
public static string ConnectionString
{
get
{
var fromEnv = Environment.GetEnvironmentVariable(EnvVar);
return string.IsNullOrWhiteSpace(fromEnv) ? DefaultConnectionString : fromEnv;
}
}
public static string ConnectionString => PlaywrightDbConnection.ConnectionString;
/// <summary>
/// Inserts a single <c>Parked</c> row into the central <c>Notifications</c> table.