using Microsoft.UI.Xaml.Media; using XFEWorkflow.Abstractions; using XFEWorkflow.Core.Runtime; using XFEWorkflow.Infrastructure.Storage; using XFEWorkflow.Services; namespace XFEWorkflow.Views; public sealed partial class MainPage { internal async Task SmokeTypedWorkbenchAsync(string output) { await ready.Task; var previous = ViewModel.SelectedWorkflow; var size = App.MainWindow.AppWindow.Size; var workflow = new WorkflowDefinition { Name = "端口类型与视角验收", Enabled = false, PluginVersions = new() { ["xfe.wecom"] = "3.0.0" }, Graph = new() { Nodes = [new() { Id = "receive", CapabilityId = "xfe.wecom.message.received", Name = "接收企微消息", X = 0, Y = 0, Trigger = new() { Kind = TriggerKind.Plugin, CapabilityId = "xfe.wecom.message.received" } }, new() { Id = "reply", CapabilityId = "xfe.wecom.quoteReply", Name = "引用回复", X = 440, Y = 0, Parameters = new() { ["content"] = "1" } }, new() { Id = "convert", CapabilityId = "core.convert.string", Name = "转换为文本", X = 440, Y = 410 }] } }; try { var scale = XamlRoot.RasterizationScale; App.MainWindow.AppWindow.Resize(new((int)(1600 * scale), (int)(1060 * scale))); await ViewModel.NewAsync(workflow); App.MainWindow.Activate(); UiSmokeTest.SetForegroundWindow(WinRT.Interop.WindowNative.GetWindowHandle(App.MainWindow)); await Task.Delay(150); await CanvasEditor.SmokeTypedPortsAsync(output, async () => { ShowProperties(CanvasEditor.Graph.Nodes.Single(x => x.Id == "reply")); await Task.Delay(100); var text = string.Join("\n", UiSmokeTest.Descendants(PropertyPanel).Select(x => x.Text)); if (!text.Contains("输入连接点 · message") || !text.Contains("来自:接收企微消息 · message") || !text.Contains("content(文本)") || UiSmokeTest.Descendants