test(e2e): unify toast assertion + extract shared PlaywrightDbConnection (review cleanups)
This commit is contained in:
+4
-15
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user