test(e2e): add InstanceConfigureFixture (template+attr+connection+area+instance on site-a)
Also extends AddAttributeAsync with an optional dataSourceReference parameter so the fixture attribute appears in both _bindingDataSourceAttrs (bindings UI) and _overrideAttrs (overrides UI) on the InstanceConfigure page.
This commit is contained in:
@@ -70,14 +70,34 @@ public static partial class CliRunner
|
||||
/// (<c>Boolean</c>, <c>Int32</c>, <c>Double</c>, <c>String</c>).
|
||||
/// Defaults to <c>Double</c>.
|
||||
/// </param>
|
||||
/// <param name="dataSourceReference">
|
||||
/// Optional data source reference (tag path). When provided, maps to
|
||||
/// <c>--data-source</c> on the CLI and sets
|
||||
/// <c>TemplateAttribute.DataSourceReference</c>. The InstanceConfigure page
|
||||
/// populates <c>_bindingDataSourceAttrs</c> by filtering attributes to those
|
||||
/// where <c>DataSourceReference</c> is non-empty, so an attribute that needs
|
||||
/// to appear in the Connection Bindings panel MUST be created with this set.
|
||||
/// </param>
|
||||
/// <exception cref="InvalidOperationException">The CLI failed.</exception>
|
||||
public static async Task AddAttributeAsync(int templateId, string name, string dataType = "Double")
|
||||
public static async Task AddAttributeAsync(
|
||||
int templateId, string name, string dataType = "Double",
|
||||
string? dataSourceReference = null)
|
||||
{
|
||||
await RunAsync(
|
||||
var inv = System.Globalization.CultureInfo.InvariantCulture;
|
||||
var args = new List<string>
|
||||
{
|
||||
"template", "attribute", "add",
|
||||
"--template-id", templateId.ToString(System.Globalization.CultureInfo.InvariantCulture),
|
||||
"--template-id", templateId.ToString(inv),
|
||||
"--name", name,
|
||||
"--data-type", dataType);
|
||||
"--data-type", dataType,
|
||||
};
|
||||
if (!string.IsNullOrEmpty(dataSourceReference))
|
||||
{
|
||||
args.Add("--data-source");
|
||||
args.Add(dataSourceReference);
|
||||
}
|
||||
|
||||
await RunAsync([.. args]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user