diff --git a/docs/ui-consistency/evidence/ot13-common/MONACO.md b/docs/ui-consistency/evidence/ot13-common/MONACO.md new file mode 100644 index 000000000..37adce45d --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/MONACO.md @@ -0,0 +1,9 @@ +# Monaco accessible-name API + +Accepted bounded common change: additive `AriaLabel` with fallback Code editor, passed to actual editor creation and existing setEditorOption→editor.updateOptions. Creation captures its label so a parameter changed while initialization waits is applied afterward; added label synchronization does not run after disposal. Existing language, value, equipment/intellisense context, sync budgets, diagnostics, model operations, theme controls and disposal/error handling remain unchanged otherwise. This does not certify or refactor preexisting late-create/disposal behavior beyond the recorded tests. + +Scope: shared MonacoEditor.razor, monaco-init.js and new MonacoAccessibilityTests.cs. Default-option regression red1, then19 targeted new+existing accessibility/disposal/sync/source tests pass (monaco-label-green.log). Tests verify creation/default, updated caller name with no setValue and preserved code/language/equipment options, and a name changed during delayed creation. + +Actual component/real vendored Monaco at1440/390 passes2/2 in monaco-native-name.json. Native Chrome EditContext uses a zero-box internal DIV textbox; the first visible-box wait was inappropriate. Corrected proof checks the focused/editable, non-ignored native accessibility textbox inside the actual Monaco editor, then its updated accessible name. The first broad .monaco-editor click also matched the separate overflow helper; scoped data-uri targeting corrected the harness. Failed logs remain. Actual model text `return 1;`, language csharp and equipment-local context remain identical after rename and live GetValueAsync returns the same text. No outer-wrapper-only naming claim is used. + +The disposable fixture returns an explicitly synthetic empty diagnostic projection and never executes a script or contacts a fleet/analysis service. Screenshots and raw AX properties are retained; no deployed-host or all-screen keyboard-editor claim is made. Context-specific production caller names roll out separately through OT13/common callsites. diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-1440.png b/docs/ui-consistency/evidence/ot13-common/monaco-1440.png new file mode 100644 index 000000000..bb7f7f122 Binary files /dev/null and b/docs/ui-consistency/evidence/ot13-common/monaco-1440.png differ diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-390.png b/docs/ui-consistency/evidence/ot13-common/monaco-390.png new file mode 100644 index 000000000..3f59a8abe Binary files /dev/null and b/docs/ui-consistency/evidence/ot13-common/monaco-390.png differ diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-label-green.log b/docs/ui-consistency/evidence/ot13-common/monaco-label-green.log new file mode 100644 index 000000000..68c4022fc --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-label-green.log @@ -0,0 +1,52 @@ + + ZB.MOM.WW.OtOpcUa.Analyzers -> /Users/dohertj2/Desktop/OtOpcUa/src/Tooling/ZB.MOM.WW.OtOpcUa.Analyzers/bin/Release/netstandard2.0/ZB.MOM.WW.OtOpcUa.Analyzers.dll + ZB.MOM.WW.OtOpcUa.Core.Abstractions -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Abstractions/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Abstractions.dll + ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing.dll + ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.dll + ZB.MOM.WW.OtOpcUa.Commons -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Commons/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Commons.dll + ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.dll + ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.dll + ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport.dll + ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser.dll + ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts.dll + ZB.MOM.WW.OtOpcUa.Cluster -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Cluster.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect.dll + ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.dll + ZB.MOM.WW.OtOpcUa.Core.Scripting -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Scripting.dll + ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport.dll + ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser.dll + ZB.MOM.WW.OtOpcUa.Core.VirtualTags -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session.dll + ZB.MOM.WW.OtOpcUa.Configuration -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Configuration.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser.dll + ZB.MOM.WW.OtOpcUa.Core -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.dll + ZB.MOM.WW.OtOpcUa.Security -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.Security/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Security.dll + ZB.MOM.WW.OtOpcUa.Driver.Heidenhain -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.dll + ZB.MOM.WW.OtOpcUa.Driver.FOCAS -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.dll + ZB.MOM.WW.OtOpcUa.OpcUaServer -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.OpcUaServer.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.dll + ZB.MOM.WW.OtOpcUa.ControlPlane -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.ControlPlane.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.dll + ZB.MOM.WW.OtOpcUa.Driver.MTConnect -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.dll + ZB.MOM.WW.OtOpcUa.Driver.AbCip -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbCip.dll + ZB.MOM.WW.OtOpcUa.Driver.AbLegacy -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.dll + ZB.MOM.WW.OtOpcUa.Runtime -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Runtime.dll + ZB.MOM.WW.OtOpcUa.AdminUI -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.dll + ZB.MOM.WW.OtOpcUa.AdminUI.Tests -> /Users/dohertj2/Desktop/OtOpcUa/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll +Test run for /Users/dohertj2/Desktop/OtOpcUa/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. + +Passed! - Failed: 0, Passed: 19, Skipped: 0, Total: 19, Duration: 160 ms - ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll (net10.0) diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-label-red.log b/docs/ui-consistency/evidence/ot13-common/monaco-label-red.log new file mode 100644 index 000000000..c009763ad --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-label-red.log @@ -0,0 +1,61 @@ + + ZB.MOM.WW.OtOpcUa.Analyzers -> /Users/dohertj2/Desktop/OtOpcUa/src/Tooling/ZB.MOM.WW.OtOpcUa.Analyzers/bin/Release/netstandard2.0/ZB.MOM.WW.OtOpcUa.Analyzers.dll + ZB.MOM.WW.OtOpcUa.Core.Abstractions -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Abstractions/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Abstractions.dll + ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Scripting.Abstractions.dll + ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Addressing.dll + ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Calculation.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Ab.Transport.dll + ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.S7.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Contracts.dll + ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Contracts.dll + ZB.MOM.WW.OtOpcUa.Commons -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Commons/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Commons.dll + ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbCip.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Dialect.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Session.dll + ZB.MOM.WW.OtOpcUa.Core.Scripting -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.Scripting/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.Scripting.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Browser.dll + ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Modbus.Contracts.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.Browser.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser.dll + ZB.MOM.WW.OtOpcUa.Cluster -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Cluster/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Cluster.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Transport.dll + ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.ScriptedAlarms.dll + ZB.MOM.WW.OtOpcUa.Core.VirtualTags -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core.VirtualTags/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.VirtualTags.dll + ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Browser.dll + ZB.MOM.WW.OtOpcUa.Configuration -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Configuration/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Configuration.dll + ZB.MOM.WW.OtOpcUa.Core -> /Users/dohertj2/Desktop/OtOpcUa/src/Core/ZB.MOM.WW.OtOpcUa.Core/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Core.dll + ZB.MOM.WW.OtOpcUa.Security -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.Security/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Security.dll + ZB.MOM.WW.OtOpcUa.OpcUaServer -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.OpcUaServer.dll + ZB.MOM.WW.OtOpcUa.Driver.Sql -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Sql/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Sql.dll + ZB.MOM.WW.OtOpcUa.Driver.MTConnect -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.MTConnect/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.MTConnect.dll + ZB.MOM.WW.OtOpcUa.Driver.Heidenhain -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Heidenhain.dll + ZB.MOM.WW.OtOpcUa.Driver.Galaxy -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.Galaxy/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.Galaxy.dll + ZB.MOM.WW.OtOpcUa.Driver.AbCip -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbCip/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbCip.dll + ZB.MOM.WW.OtOpcUa.Driver.AbLegacy -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.dll + ZB.MOM.WW.OtOpcUa.Driver.FOCAS -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.FOCAS/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.FOCAS.dll + ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient -> /Users/dohertj2/Desktop/OtOpcUa/src/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.dll + ZB.MOM.WW.OtOpcUa.ControlPlane -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.ControlPlane/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.ControlPlane.dll + ZB.MOM.WW.OtOpcUa.Runtime -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.Runtime.dll + ZB.MOM.WW.OtOpcUa.AdminUI -> /Users/dohertj2/Desktop/OtOpcUa/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.dll + ZB.MOM.WW.OtOpcUa.AdminUI.Tests -> /Users/dohertj2/Desktop/OtOpcUa/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll +Test run for /Users/dohertj2/Desktop/OtOpcUa/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/bin/Release/net10.0/ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll (.NETCoreApp,Version=v10.0) +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:01.30] ZB.MOM.WW.OtOpcUa.AdminUI.Tests.ScriptAnalysis.MonacoAccessibilityTests.DefaultName_IsPartOfNativeEditorCreationOptions [FAIL] + Failed ZB.MOM.WW.OtOpcUa.AdminUI.Tests.ScriptAnalysis.MonacoAccessibilityTests.DefaultName_IsPartOfNativeEditorCreationOptions [140 ms] + Error Message: + Shouldly.ShouldAssertException : options.GetType().GetProperty("ariaLabel") + should not be null but was + Stack Trace: + at ZB.MOM.WW.OtOpcUa.AdminUI.Tests.ScriptAnalysis.MonacoAccessibilityTests.DefaultName_IsPartOfNativeEditorCreationOptions() in /Users/dohertj2/Desktop/OtOpcUa/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ScriptAnalysis/MonacoAccessibilityTests.cs:line 27 + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) + +Failed! - Failed: 1, Passed: 0, Skipped: 0, Total: 1, Duration: 144 ms - ZB.MOM.WW.OtOpcUa.AdminUI.Tests.dll (net10.0) diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-native-name-confirmation.log b/docs/ui-consistency/evidence/ot13-common/monaco-native-name-confirmation.log new file mode 100644 index 000000000..3b1854e56 --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-native-name-confirmation.log @@ -0,0 +1,37 @@ +Traceback (most recent call last): + File "/Users/dohertj2/Desktop/OtOpcUa/infra/tools/ui-consistency/check_monaco_name.py", line 9, in + page=b.new_page(viewport={'width':width,'height':900});errors=[];page.on('pageerror',lambda e:errors.append(str(e)));page.goto(origin+'/editor-pilot',wait_until='networkidle');box=page.get_by_role('textbox',name=re.compile('^Calculation script source'));box.wait_for(state='attached');page.locator('.monaco-editor').click();initial=box.evaluate('e=>({tag:e.tagName,role:e.getAttribute("role"),label:e.getAttribute("aria-label"),internal:!!e.closest(".monaco-editor")})');axBefore=page.context.new_cdp_session(page).send('Accessibility.getFullAXTree')['nodes'];accessibleBefore=[{'name':n.get('name',{}).get('value'),'role':n.get('role',{}).get('value'),'ignored':n.get('ignored'),'properties':n.get('properties')} for n in axBefore if n.get('role',{}).get('value')=='textbox' and str(n.get('name',{}).get('value','')).startswith('Calculation script source')];before=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#rename-editor').click();updated=page.get_by_role('textbox',name=re.compile('^Updated calculation script source'));updated.wait_for(state='attached');after=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#read-editor').click();page.wait_for_function('document.querySelector("#editor-read").textContent==="return 1;"');axAfter=page.context.new_cdp_session(page).send('Accessibility.getFullAXTree')['nodes'];accessibleAfter=[{'name':n.get('name',{}).get('value'),'role':n.get('role',{}).get('value'),'ignored':n.get('ignored')} for n in axAfter if n.get('role',{}).get('value')=='textbox' and str(n.get('name',{}).get('value','')).startswith('Updated calculation script source')];record={'width':width,'accessibleBefore':accessibleBefore,'accessibleAfter':accessibleAfter,'initial':initial,'updatedLabel':updated.get_attribute('aria-label'),'before':before,'after':after,'read':page.locator('#editor-read').inner_text(),'errors':errors,'layout':page.evaluate('({width:innerWidth,document:document.documentElement.scrollWidth})')};record['passed']=initial['internal'] and len(accessibleBefore)==1 and not accessibleBefore[0]['ignored'] and len(accessibleAfter)==1 and not accessibleAfter[0]['ignored'] and before==after and before[0]['text']=='return 1;' and before[0]['language']=='csharp' and before[0]['equipment']=='equipment-local' and not errors and record['layout']['width']==record['layout']['document'];out.append(record);page.screenshot(path=f'docs/ui-consistency/evidence/ot13-common/monaco-{width}.png');page.close() + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 15631, in click + self._sync( + ~~~~~~~~~~^ + self._impl_obj.click( + ^^^^^^^^^^^^^^^^^^^^^ + ...<10 lines>... + ) + ^ + ) + ^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync + return task.result() + ~~~~~~~~~~~^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_locator.py", line 162, in click + return await self._frame._click(self._selector, strict=True, **params) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_frame.py", line 566, in _click + await self._channel.send("click", self._timeout, locals_to_params(locals())) + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 69, in send + return await self._connection.wrap_api_call( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ...<3 lines>... + ) + ^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 559, in wrap_api_call + raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None +playwright._impl._errors.Error: Locator.click: Error: strict mode violation: locator(".monaco-editor") resolved to 2 elements: + 1)
…
aka get_by_role("code") + 2)
…
aka locator("#otopcua-monaco-overflow") + +Call log: + - waiting for locator(".monaco-editor") + diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-native-name-scoped-confirmation.log b/docs/ui-consistency/evidence/ot13-common/monaco-native-name-scoped-confirmation.log new file mode 100644 index 000000000..0141774e9 --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-native-name-scoped-confirmation.log @@ -0,0 +1 @@ +{'cases': 2, 'passed': 2} diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-native-name.json b/docs/ui-consistency/evidence/ot13-common/monaco-native-name.json new file mode 100644 index 000000000..c9437bfdc --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-native-name.json @@ -0,0 +1,222 @@ +[ + { + "width": 1440, + "accessibleBefore": [ + { + "name": "Calculation script source", + "role": "textbox", + "ignored": false, + "properties": [ + { + "name": "focusable", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "focused", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "editable", + "value": { + "type": "token", + "value": "richtext" + } + }, + { + "name": "settable", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "autocomplete", + "value": { + "type": "token", + "value": "both" + } + }, + { + "name": "multiline", + "value": { + "type": "boolean", + "value": true + } + }, + { + "name": "readonly", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "required", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "roledescription", + "value": { + "type": "string", + "value": "editor" + } + } + ] + } + ], + "accessibleAfter": [ + { + "name": "Updated calculation script source", + "role": "textbox", + "ignored": false + } + ], + "initial": { + "tag": "DIV", + "role": "textbox", + "label": "Calculation script source", + "internal": true + }, + "updatedLabel": "Updated calculation script source", + "before": [ + { + "text": "return 1;", + "language": "csharp", + "equipment": "equipment-local" + } + ], + "after": [ + { + "text": "return 1;", + "language": "csharp", + "equipment": "equipment-local" + } + ], + "read": "return 1;", + "errors": [], + "layout": { + "width": 1440, + "document": 1440 + }, + "passed": true + }, + { + "width": 390, + "accessibleBefore": [ + { + "name": "Calculation script source", + "role": "textbox", + "ignored": false, + "properties": [ + { + "name": "focusable", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "focused", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "editable", + "value": { + "type": "token", + "value": "richtext" + } + }, + { + "name": "settable", + "value": { + "type": "booleanOrUndefined", + "value": true + } + }, + { + "name": "autocomplete", + "value": { + "type": "token", + "value": "both" + } + }, + { + "name": "multiline", + "value": { + "type": "boolean", + "value": true + } + }, + { + "name": "readonly", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "required", + "value": { + "type": "boolean", + "value": false + } + }, + { + "name": "roledescription", + "value": { + "type": "string", + "value": "editor" + } + } + ] + } + ], + "accessibleAfter": [ + { + "name": "Updated calculation script source", + "role": "textbox", + "ignored": false + } + ], + "initial": { + "tag": "DIV", + "role": "textbox", + "label": "Calculation script source", + "internal": true + }, + "updatedLabel": "Updated calculation script source", + "before": [ + { + "text": "return 1;", + "language": "csharp", + "equipment": "equipment-local" + } + ], + "after": [ + { + "text": "return 1;", + "language": "csharp", + "equipment": "equipment-local" + } + ], + "read": "return 1;", + "errors": [], + "layout": { + "width": 390, + "document": 390 + }, + "passed": true + } +] \ No newline at end of file diff --git a/docs/ui-consistency/evidence/ot13-common/monaco-native-name.log b/docs/ui-consistency/evidence/ot13-common/monaco-native-name.log new file mode 100644 index 000000000..07b03a3ca --- /dev/null +++ b/docs/ui-consistency/evidence/ot13-common/monaco-native-name.log @@ -0,0 +1,31 @@ +Traceback (most recent call last): + File "/Users/dohertj2/Desktop/OtOpcUa/infra/tools/ui-consistency/check_monaco_name.py", line 9, in + page=b.new_page(viewport={'width':width,'height':900});errors=[];page.on('pageerror',lambda e:errors.append(str(e)));page.goto(origin+'/editor-pilot',wait_until='networkidle');box=page.get_by_role('textbox',name=re.compile('^Calculation script source'));box.wait_for();initial=box.evaluate('e=>({tag:e.tagName,role:e.getAttribute("role"),label:e.getAttribute("aria-label"),internal:!!e.closest(".monaco-editor")})');before=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#rename-editor').click();updated=page.get_by_role('textbox',name=re.compile('^Updated calculation script source'));updated.wait_for();after=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#read-editor').click();page.wait_for_function('document.querySelector("#editor-read").textContent==="return 1;"');record={'width':width,'initial':initial,'updatedLabel':updated.get_attribute('aria-label'),'before':before,'after':after,'read':page.locator('#editor-read').inner_text(),'errors':errors,'layout':page.evaluate('({width:innerWidth,document:document.documentElement.scrollWidth})')};record['passed']=initial['internal'] and before==after and before[0]['text']=='return 1;' and before[0]['language']=='csharp' and before[0]['equipment']=='equipment-local' and not errors and record['layout']['width']==record['layout']['document'];out.append(record);page.screenshot(path=f'docs/ui-consistency/evidence/ot13-common/monaco-{width}.png');page.close() + ~~~~~~~~~~~~^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/sync_api/_generated.py", line 18074, in wait_for + self._sync(self._impl_obj.wait_for(timeout=timeout, state=state)) + ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync + return task.result() + ~~~~~~~~~~~^^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_locator.py", line 710, in wait_for + await self._frame.wait_for_selector( + self._selector, strict=True, timeout=timeout, state=state + ) + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_frame.py", line 369, in wait_for_selector + await self._channel.send( + "waitForSelector", self._timeout, locals_to_params(locals()) + ) + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 69, in send + return await self._connection.wrap_api_call( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ...<3 lines>... + ) + ^ + File "/opt/homebrew/lib/python3.14/site-packages/playwright/_impl/_connection.py", line 559, in wrap_api_call + raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None +playwright._impl._errors.TimeoutError: Locator.wait_for: Timeout 30000ms exceeded. +Call log: + - waiting for get_by_role("textbox", name=re.compile(r"^Calculation script source")) to be visible + 64 × locator resolved to hidden
+ diff --git a/infra/tools/ui-consistency/check_monaco_name.py b/infra/tools/ui-consistency/check_monaco_name.py new file mode 100644 index 000000000..d06b2b056 --- /dev/null +++ b/infra/tools/ui-consistency/check_monaco_name.py @@ -0,0 +1,11 @@ +"""Actual internal Monaco textbox naming and model preservation, local fixture only.""" +from pathlib import Path +from playwright.sync_api import sync_playwright +import re,json +origin=re.search(r'Now listening on: (http://127.0.0.1:\d+)',Path('/tmp/ot-pilot-host.log').read_text()).group(1);out=[] +with sync_playwright() as p: + b=p.chromium.launch(channel='chromium') + for width in [1440,390]: + page=b.new_page(viewport={'width':width,'height':900});errors=[];page.on('pageerror',lambda e:errors.append(str(e)));page.goto(origin+'/editor-pilot',wait_until='networkidle');box=page.get_by_role('textbox',name=re.compile('^Calculation script source'));box.wait_for(state='attached');page.locator('.monaco-editor[data-uri]').click();initial=box.evaluate('e=>({tag:e.tagName,role:e.getAttribute("role"),label:e.getAttribute("aria-label"),internal:!!e.closest(".monaco-editor")})');axBefore=page.context.new_cdp_session(page).send('Accessibility.getFullAXTree')['nodes'];accessibleBefore=[{'name':n.get('name',{}).get('value'),'role':n.get('role',{}).get('value'),'ignored':n.get('ignored'),'properties':n.get('properties')} for n in axBefore if n.get('role',{}).get('value')=='textbox' and str(n.get('name',{}).get('value','')).startswith('Calculation script source')];before=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#rename-editor').click();updated=page.get_by_role('textbox',name=re.compile('^Updated calculation script source'));updated.wait_for(state='attached');after=page.evaluate('monaco.editor.getModels().map(m=>({text:m.getValue(),language:m.getLanguageId(),equipment:m.__otEquipmentId}))');page.locator('#read-editor').click();page.wait_for_function('document.querySelector("#editor-read").textContent==="return 1;"');axAfter=page.context.new_cdp_session(page).send('Accessibility.getFullAXTree')['nodes'];accessibleAfter=[{'name':n.get('name',{}).get('value'),'role':n.get('role',{}).get('value'),'ignored':n.get('ignored')} for n in axAfter if n.get('role',{}).get('value')=='textbox' and str(n.get('name',{}).get('value','')).startswith('Updated calculation script source')];record={'width':width,'accessibleBefore':accessibleBefore,'accessibleAfter':accessibleAfter,'initial':initial,'updatedLabel':updated.get_attribute('aria-label'),'before':before,'after':after,'read':page.locator('#editor-read').inner_text(),'errors':errors,'layout':page.evaluate('({width:innerWidth,document:document.documentElement.scrollWidth})')};record['passed']=initial['internal'] and len(accessibleBefore)==1 and not accessibleBefore[0]['ignored'] and len(accessibleAfter)==1 and not accessibleAfter[0]['ignored'] and before==after and before[0]['text']=='return 1;' and before[0]['language']=='csharp' and before[0]['equipment']=='equipment-local' and not errors and record['layout']['width']==record['layout']['document'];out.append(record);page.screenshot(path=f'docs/ui-consistency/evidence/ot13-common/monaco-{width}.png');page.close() + b.close() +Path('docs/ui-consistency/evidence/ot13-common/monaco-native-name.json').write_text(json.dumps(out,indent=2));print({'cases':len(out),'passed':sum(r['passed'] for r in out)});raise SystemExit(0 if all(r['passed'] for r in out) else 1) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/MonacoEditor.razor b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/MonacoEditor.razor index d0b95d3c7..184983314 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/MonacoEditor.razor +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/Components/Shared/MonacoEditor.razor @@ -39,6 +39,8 @@ [Parameter] public string Value { get; set; } = ""; /// Raised with the editor text when the editor loses focus after an edit (and from ). [Parameter] public EventCallback ValueChanged { get; set; } + /// The domain-specific accessible name passed to Monaco's internal text editor. + [Parameter] public string AriaLabel { get; set; } = "Code editor"; [Parameter] public string Language { get; set; } = "csharp"; [Parameter] public string Height { get; set; } = "320px"; [Parameter] public bool ReadOnly { get; set; } = false; @@ -64,6 +66,9 @@ private DotNetObjectReference? _dotNetRef; private readonly string _id = Guid.NewGuid().ToString("N"); private string _lastSentValue = ""; + private string _lastSentAriaLabel = ""; + private string AccessibleLabel => string.IsNullOrWhiteSpace(AriaLabel) ? "Code editor" : AriaLabel; + private bool _disposed; private bool _initialized; private int _tooLargeBytes; private bool _wrap; @@ -76,6 +81,7 @@ { _dotNetRef = DotNetObjectReference.Create(this); _lastSentValue = Value ?? ""; + var createdLabel = AccessibleLabel; try { await JS.InvokeVoidAsync( @@ -85,6 +91,7 @@ new { value = Value ?? "", + ariaLabel = createdLabel, language = Language, readOnly = ReadOnly, equipmentId = EquipmentId, @@ -95,6 +102,7 @@ }, _dotNetRef); _initialized = true; + _lastSentAriaLabel = createdLabel; } catch (InvalidOperationException) { @@ -116,6 +124,11 @@ _lastSentValue = Value ?? ""; await SafeInvokeAsync("MonacoBlazor.setValue", "set editor value", _id, _lastSentValue); } + if (!_disposed && _initialized && AccessibleLabel != _lastSentAriaLabel) + { + _lastSentAriaLabel = AccessibleLabel; + await SafeInvokeAsync("MonacoBlazor.setEditorOption", "set accessible editor name", _id, "ariaLabel", _lastSentAriaLabel); + } } /// @@ -237,6 +250,7 @@ public async ValueTask DisposeAsync() { + _disposed = true; try { if (_initialized) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js index e5fc3f0e0..69abe5202 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js +++ b/src/Server/ZB.MOM.WW.OtOpcUa.AdminUI/wwwroot/js/monaco-init.js @@ -231,6 +231,7 @@ if (!host) return; const editor = monaco.editor.create(host, { value: options.value || "", language: options.language || "csharp", + ariaLabel: typeof options.ariaLabel === "string" && options.ariaLabel.trim() ? options.ariaLabel : "Code editor", theme: "vs", minimap: { enabled: false }, scrollBeyondLastLine: false, automaticLayout: true, fontSize: 13, lineNumbers: "on", renderLineHighlight: "line", readOnly: !!options.readOnly, diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ScriptAnalysis/MonacoAccessibilityTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ScriptAnalysis/MonacoAccessibilityTests.cs new file mode 100644 index 000000000..f6d1b24e4 --- /dev/null +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/ScriptAnalysis/MonacoAccessibilityTests.cs @@ -0,0 +1,60 @@ +using Bunit; +using Microsoft.Extensions.DependencyInjection; +using Shouldly; +using Xunit; +using ZB.MOM.WW.OtOpcUa.AdminUI.Components.Shared; + +namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.ScriptAnalysis; + +/// Editor names reach the real Monaco creation/update contract without changing content. +[Trait("Category", "Unit")] +public sealed class MonacoAccessibilityTests : BunitContext +{ + public MonacoAccessibilityTests() + { + Services.AddLogging(); + JSInterop.SetupVoid("MonacoBlazor.dispose", _ => true).SetVoidResult(); + JSInterop.SetupVoid("MonacoBlazor.setEditorOption", _ => true).SetVoidResult(); + } + + /// The fallback name is sent to Monaco, not only placed on an outer wrapper. + [Fact] + public void DefaultName_IsPartOfNativeEditorCreationOptions() + { + JSInterop.SetupVoid("MonacoBlazor.createEditor", _ => true).SetVoidResult(); + Render(); + var options = JSInterop.Invocations["MonacoBlazor.createEditor"].Single().Arguments[2]!; + options.GetType().GetProperty("ariaLabel").ShouldNotBeNull(); + options.GetType().GetProperty("ariaLabel")!.GetValue(options).ShouldBe("Code editor"); + } + /// Renaming the editor uses existing updateOptions without changing its text/context/language. + [Fact] + public void CallerName_UpdatesWithoutReplacingContentOrLanguage() + { + JSInterop.SetupVoid("MonacoBlazor.createEditor", _ => true).SetVoidResult(); + var cut = Render(p => p.Add(x => x.AriaLabel, "Calculation script source") + .Add(x => x.Value, "return 1;").Add(x => x.Language, "csharp").Add(x => x.EquipmentId, "equipment-local")); + var options = JSInterop.Invocations["MonacoBlazor.createEditor"].Single().Arguments[2]!; + options.GetType().GetProperty("ariaLabel")!.GetValue(options).ShouldBe("Calculation script source"); + options.GetType().GetProperty("value")!.GetValue(options).ShouldBe("return 1;"); + options.GetType().GetProperty("language")!.GetValue(options).ShouldBe("csharp"); + options.GetType().GetProperty("equipmentId")!.GetValue(options).ShouldBe("equipment-local"); + cut.Render(p => p.Add(x => x.AriaLabel, "Updated script source")); + var update = JSInterop.Invocations["MonacoBlazor.setEditorOption"].Single(); + update.Arguments[1].ShouldBe("ariaLabel"); + update.Arguments[2].ShouldBe("Updated script source"); + JSInterop.Invocations["MonacoBlazor.setValue"].ShouldBeEmpty(); + } + + /// A name changed during a delayed creation is synchronized after creation completes. + [Fact] + public void CallerName_ChangedWhileCreationWaits_IsNotLost() + { + var create = JSInterop.SetupVoid("MonacoBlazor.createEditor", _ => true); + var cut = Render(p => p.Add(x => x.AriaLabel, "First name")); + cut.Render(p => p.Add(x => x.AriaLabel, "Current name")); + create.SetVoidResult(); + cut.WaitForAssertion(() => JSInterop.Invocations["MonacoBlazor.setEditorOption"].Last().Arguments[2].ShouldBe("Current name")); + } + +}