Associate ScadaBridge controls, guidance and editor errors
This commit is contained in:
@@ -297,10 +297,10 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
// The method pane is the shared ParameterValueForm (typed inputs by field id), and
|
||||
// Run is gated on its validity — MachineCode is required, so Run stays off until it is set.
|
||||
Assert.NotEmpty(cut.FindAll("[data-test='flow-method-params']"));
|
||||
Assert.NotNull(cut.Find("#param-MachineCode"));
|
||||
Assert.NotNull(cut.Find("#param-Qty"));
|
||||
Assert.NotNull(cut.Find("[data-param-path='MachineCode']"));
|
||||
Assert.NotNull(cut.Find("[data-param-path='Qty']"));
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
cut.Find("#param-MachineCode").Input("Z28061");
|
||||
cut.Find("[data-param-path='MachineCode']").Input("Z28061");
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
}
|
||||
|
||||
@@ -316,8 +316,8 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
cut.Find("select[data-test='flow-method-select']").Change("4");
|
||||
FillRequiredMethodInput(cut);
|
||||
|
||||
cut.Find("#param-MachineCode").Input("Z28061");
|
||||
cut.Find("#param-Qty").Input("3");
|
||||
cut.Find("[data-param-path='MachineCode']").Input("Z28061");
|
||||
cut.Find("[data-param-path='Qty']").Input("3");
|
||||
cut.Find("button[data-test='flow-run']").Click();
|
||||
|
||||
cut.WaitForAssertion(() => Assert.Equal("Completed", cut.Find("[data-test='flow-state']").TextContent.Trim()));
|
||||
@@ -791,7 +791,7 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
|
||||
Assert.NotEmpty(cut.FindAll("[data-test='flow-script-params']"));
|
||||
Assert.Empty(cut.FindAll("input[data-test='flow-input-value']"));
|
||||
cut.Find("#param-n").Input("3");
|
||||
cut.Find("[data-param-path='n']").Input("3");
|
||||
cut.Find("button[data-test='flow-run']").Click();
|
||||
cut.WaitForAssertion(() => Assert.Equal("Completed", cut.Find("[data-test='flow-state']").TextContent.Trim()));
|
||||
_ = _flow.Received(1).RunScriptAsync(7, "Manual", Arg.Is<JsonElement?>(p => p != null && p.Value.GetProperty("n").GetInt64() == 3), null, Arg.Any<CancellationToken>());
|
||||
@@ -851,7 +851,7 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
cut.Find("select[data-test='flow-site-select']").Change("1");
|
||||
PickInstance(cut, 7);
|
||||
cut.Find("select[data-test='flow-script-select']").Change("Manual");
|
||||
cut.Find("#param-n").Input("abc"); // not an integer: the form parks a parse error
|
||||
cut.Find("[data-param-path='n']").Input("abc"); // not an integer: the form parks a parse error
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
return cut;
|
||||
}
|
||||
@@ -868,10 +868,10 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
|
||||
// A fresh form: no echo of the previous script's text, and no stale parse error keeping
|
||||
// Run disabled invisibly — Run is disabled only because the required field is unset.
|
||||
Assert.Equal(string.Empty, cut.Find("#param-n").GetAttribute("value"));
|
||||
Assert.Equal(string.Empty, cut.Find("[data-param-path='n']").GetAttribute("value"));
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
|
||||
cut.Find("#param-n").Input("5");
|
||||
cut.Find("[data-param-path='n']").Input("5");
|
||||
Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
}
|
||||
|
||||
@@ -1298,7 +1298,7 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
/// </summary>
|
||||
private static void FillRequiredMethodInput(IRenderedComponent<FlowDebuggerPage> cut)
|
||||
{
|
||||
cut.WaitForElement("#param-MachineCode").Input("Z28061");
|
||||
cut.WaitForElement("[data-param-path='MachineCode']").Input("Z28061");
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
}
|
||||
|
||||
@@ -1314,16 +1314,16 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
.Returns(GraphOutcome(withSite: true, withChildId: true));
|
||||
var cut = Render<FlowDebuggerPage>();
|
||||
cut.Find("select[data-test='flow-method-select']").Change("5");
|
||||
cut.WaitForElement("#param-SAPID");
|
||||
cut.WaitForElement("[data-param-path='SAPID']");
|
||||
|
||||
// Required array unset → Run off. Add two work orders through the list editor.
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
cut.Find("#param-SAPID").Input("103559_A");
|
||||
cut.Find("[data-param-path='SAPID']").Input("103559_A");
|
||||
cut.Find("button.param-list-add").Click();
|
||||
cut.Find("button.param-list-add").Click();
|
||||
cut.Find("[id='param-WorkOrders[0].WorkOrderNumber']").Input("WO-1");
|
||||
cut.Find("[id='param-WorkOrders[0].PartNumber']").Input("P-1");
|
||||
cut.Find("[id='param-WorkOrders[1].WorkOrderNumber']").Input("WO-2");
|
||||
cut.Find("[data-param-path='WorkOrders[0].WorkOrderNumber']").Input("WO-1");
|
||||
cut.Find("[data-param-path='WorkOrders[0].PartNumber']").Input("P-1");
|
||||
cut.Find("[data-param-path='WorkOrders[1].WorkOrderNumber']").Input("WO-2");
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
|
||||
cut.Find("button[data-test='flow-run']").Click();
|
||||
@@ -1346,14 +1346,14 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
RegisterServices();
|
||||
var cut = Render<FlowDebuggerPage>();
|
||||
cut.Find("select[data-test='flow-method-select']").Change("5");
|
||||
cut.WaitForElement("#param-SAPID");
|
||||
cut.Find("#param-SAPID").Input("103559_A");
|
||||
cut.WaitForElement("[data-param-path='SAPID']");
|
||||
cut.Find("[data-param-path='SAPID']").Input("103559_A");
|
||||
cut.Find("button.param-list-add").Click();
|
||||
// An item exists but its required WorkOrderNumber is unset: still invalid.
|
||||
cut.Find("[id='param-WorkOrders[0].PartNumber']").Input("P-1");
|
||||
cut.Find("[data-param-path='WorkOrders[0].PartNumber']").Input("P-1");
|
||||
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
cut.Find("[id='param-WorkOrders[0].WorkOrderNumber']").Input("WO-1");
|
||||
cut.Find("[data-param-path='WorkOrders[0].WorkOrderNumber']").Input("WO-1");
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
}
|
||||
|
||||
@@ -1401,7 +1401,7 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
.Returns(GraphOutcome(withSite: true, withChildId: true));
|
||||
var cut = Render<FlowDebuggerPage>();
|
||||
cut.Find("select[data-test='flow-method-select']").Change("5");
|
||||
cut.WaitForElement("#param-SAPID");
|
||||
cut.WaitForElement("[data-param-path='SAPID']");
|
||||
|
||||
cut.Find("button[data-test='flow-input-mode-raw']").Click();
|
||||
var editor = cut.FindComponent<MonacoEditor>();
|
||||
@@ -1412,9 +1412,9 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
|
||||
// Back to the form: the parsed tree is what the item editors now show.
|
||||
cut.Find("button[data-test='flow-input-mode-form']").Click();
|
||||
cut.WaitForElement("[id='param-WorkOrders[0].WorkOrderNumber']");
|
||||
Assert.Equal("WO-1", cut.Find("[id='param-WorkOrders[0].WorkOrderNumber']").GetAttribute("value"));
|
||||
Assert.Equal("103559_A", cut.Find("#param-SAPID").GetAttribute("value"));
|
||||
cut.WaitForElement("[data-param-path='WorkOrders[0].WorkOrderNumber']");
|
||||
Assert.Equal("WO-1", cut.Find("[data-param-path='WorkOrders[0].WorkOrderNumber']").GetAttribute("value"));
|
||||
Assert.Equal("103559_A", cut.Find("[data-param-path='SAPID']").GetAttribute("value"));
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
|
||||
cut.Find("button[data-test='flow-run']").Click();
|
||||
@@ -1436,9 +1436,9 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
|
||||
cut.Find("select[data-test='flow-method-select']").Change("5");
|
||||
|
||||
cut.WaitForElement("#param-SAPID");
|
||||
Assert.Empty(cut.FindAll("#param-MachineCode"));
|
||||
Assert.Equal("", cut.Find("#param-SAPID").GetAttribute("value"));
|
||||
cut.WaitForElement("[data-param-path='SAPID']");
|
||||
Assert.Empty(cut.FindAll("[data-param-path='MachineCode']"));
|
||||
Assert.Equal("", cut.Find("[data-param-path='SAPID']").GetAttribute("value"));
|
||||
Assert.Empty(cut.FindAll(".param-list-row"));
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
}
|
||||
@@ -1453,8 +1453,8 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
var cut = Render<FlowDebuggerPage>();
|
||||
cut.Find("select[data-test='flow-method-select']").Change("4");
|
||||
|
||||
cut.WaitForAssertion(() => Assert.Equal("Z9", cut.Find("#param-MachineCode").GetAttribute("value")));
|
||||
Assert.Equal("7", cut.Find("#param-Qty").GetAttribute("value"));
|
||||
cut.WaitForAssertion(() => Assert.Equal("Z9", cut.Find("[data-param-path='MachineCode']").GetAttribute("value")));
|
||||
Assert.Equal("7", cut.Find("[data-param-path='Qty']").GetAttribute("value"));
|
||||
cut.WaitForAssertion(() => Assert.False(cut.Find("button[data-test='flow-run']").HasAttribute("disabled")));
|
||||
}
|
||||
|
||||
@@ -1470,8 +1470,8 @@ public class FlowDebuggerPageTests : BunitContext
|
||||
var cut = Render<FlowDebuggerPage>();
|
||||
cut.Find("select[data-test='flow-method-select']").Change("4");
|
||||
|
||||
cut.WaitForElement("#param-MachineCode");
|
||||
Assert.Equal("", cut.Find("#param-MachineCode").GetAttribute("value"));
|
||||
cut.WaitForElement("[data-param-path='MachineCode']");
|
||||
Assert.Equal("", cut.Find("[data-param-path='MachineCode']").GetAttribute("value"));
|
||||
Assert.True(cut.Find("button[data-test='flow-run']").HasAttribute("disabled"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user