test(playwright): alarm-override trigger-config scenarios — HiLo merge, non-HiLo replace, validation, cancel, clear (T41)

This commit is contained in:
Joseph Doherty
2026-06-18 19:35:14 -04:00
parent 2e4ca5a35f
commit b7f7fe935c
5 changed files with 312 additions and 9 deletions
@@ -36,9 +36,24 @@ public sealed class InstanceConfigureFixture : IAsyncLifetime
/// <summary>The single bindable/overridable attribute name on the fixture template.</summary>
public string AttributeName => "Value";
/// <summary>The single non-locked alarm on the fixture template (for the override test).</summary>
/// <summary>The single non-locked HiLo alarm on the fixture template (for the merge override test).</summary>
public string AlarmName => "HiHi";
/// <summary>
/// A second, non-HiLo (ValueMatch) alarm on the fixture template. HiLo overrides MERGE into
/// inherited setpoints, but ValueMatch / RangeViolation / RateOfChange overrides WHOLE-REPLACE
/// the inherited trigger config — so this alarm exercises the whole-replace path that the HiLo
/// alarm cannot. Bound to the same <see cref="AttributeName"/> (<c>Value</c>) so the
/// AlarmTriggerEditor's attribute picker already has it selected.
/// </summary>
public string NonHiLoAlarmName => "Match";
/// <summary>Trigger type of <see cref="NonHiLoAlarmName"/>.</summary>
public string NonHiLoAlarmTriggerType => "ValueMatch";
/// <summary>The inherited (template) ValueMatch value baked into <see cref="NonHiLoAlarmName"/>.</summary>
public string NonHiLoInheritedMatchValue => "100";
/// <summary>The fixture data-connection name (for locating it in the bindings UI dropdown).</summary>
public string ConnectionName { get; private set; } = string.Empty;
@@ -63,6 +78,10 @@ public sealed class InstanceConfigureFixture : IAsyncLifetime
await CliRunner.AddAttributeAsync(TemplateId, AttributeName, "Double", dataSourceReference: AttributeName);
await CliRunner.AddAlarmAsync(TemplateId, AlarmName, "HiLo", priority: 500,
attribute: AttributeName, hi: 80, hiHi: 95);
// Second, non-HiLo alarm so the whole-replace override path is covered (HiLo merges,
// ValueMatch/RangeViolation/RateOfChange whole-replace). Bound to the same attribute.
await CliRunner.AddAlarmAsync(TemplateId, NonHiLoAlarmName, NonHiLoAlarmTriggerType,
priority: 400, attribute: AttributeName, matchValue: NonHiLoInheritedMatchValue);
ConnectionName = CliRunner.UniqueName("conn");
ConnectionId = await CliRunner.CreateDataConnectionAsync(SiteAId, ConnectionName);
AreaId = await CliRunner.CreateAreaAsync(SiteAId, CliRunner.UniqueName("cfgarea"));