using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Automation.Provider;
using System.IO.Compression;
using System.Text.Json;
using XFEWorkflow.Abstractions;
using XFEWorkflow.Core.Runtime;
using XFEWorkflow.ViewModels;
using XFEWorkflow.Views;
namespace XFEWorkflow.Services;
internal static partial class UiSmokeTest
{
private static async Task SmokeWeComPanelAsync(string output)
{
var services = AppServices.Current; var navigation = AppShellPage.Current!.ViewModel.NavigationViewService;
var bundled = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "BundledPlugins", "xfe.wecom"), "plugin.json", SearchOption.AllDirectories);
if (bundled.Length != 1 || JsonSerializer.Deserialize<PluginManifest>(await File.ReadAllTextAsync(bundled[0]), WorkflowJson.Options)?.Version != "3.0.0") throw new InvalidOperationException("软件必须只打包完整的企业微信插件");
if (!services.Plugins.Installed.Any(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "1.0.0"))
{
// Reproduce an existing user's legacy installation with the real old assembly.
var standardFile = Path.Combine(services.Plugins.Installed.First(x => x.Manifest.Id == "xfe.http").Directory, "XFEWorkflow.Plugins.Standard.dll");
var standard = System.Reflection.Assembly.LoadFrom(standardFile);
using var resource = standard.GetManifestResourceStream("XFEWorkflow.Plugins.Standard.Manifests.xfe.wecom.json")!;
var legacy = JsonSerializer.Deserialize<PluginManifest>(resource, WorkflowJson.Options)!;
var package = Path.Combine(services.Paths.Temp, "legacy-wecom-ui-fixture.xfeplugin");
try
{
using (var archive = ZipFile.Open(package, ZipArchiveMode.Create))
{ using (var writer = new StreamWriter(archive.CreateEntry("plugin.json").Open())) writer.Write(JsonSerializer.Serialize(legacy, WorkflowJson.Options)); archive.CreateEntryFromFile(standardFile, legacy.Assembly); }
await services.Plugins.InstallAsync(package);
}
finally { if (File.Exists(package)) File.Delete(package); }
}
var size = App.MainWindow.AppWindow.Size; var scale = App.MainWindow.Content.XamlRoot.RasterizationScale;
App.MainWindow.AppWindow.Resize(new((int)(1920 * scale), (int)(1040 * scale)));
navigation.NavigateTo<PluginsPage>(); await WaitManagementAsync(() => Descendants<GridView>(App.MainWindow.Content).Any(x => x.Items.OfType<PluginCardModel>().Any(y => y.Manifest.Id == "xfe.wecom" && y.Manifest.Version == "3.0.0")));
var catalog = Descendants<GridView>(App.MainWindow.Content).Single(); catalog.SelectedItem = catalog.Items.OfType<PluginCardModel>().Single(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "3.0.0");
await WaitManagementAsync(() => Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
if (catalog.Items.OfType<PluginCardModel>().Count(x => x.Manifest.Id == "xfe.wecom") != 1) throw new InvalidOperationException("企业微信仍展示为多个插件");
ComboBox VersionSelector() => Descendants<ComboBox>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "PluginInstalledVersion");
VersionSelector().SelectedItem = VersionSelector().Items.OfType<InstalledPlugin>().Single(x => x.Manifest.Version == "1.0.0");
await WaitManagementAsync(() => VersionSelector().SelectedItem is InstalledPlugin { Manifest.Version: "1.0.0" } && !Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
VersionSelector().SelectedItem = VersionSelector().Items.OfType<InstalledPlugin>().Single(x => x.Manifest.Version == "3.0.0");
await WaitManagementAsync(() => Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
if (catalog.Items.OfType<PluginCardModel>().Count(x => x.Manifest.Id == "xfe.wecom") != 1) throw new InvalidOperationException("切换历史版本产生了重复插件卡片");
foreach (var id in new[] { "WeComConnect", "WeComDisconnect", "WeComStatus", "WeComProbe", "WeComImportLegacy", "WeComSelfTest", "WeComAttempts" })
if (!Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == id)) throw new InvalidOperationException("企微管理操作缺失:" + id);
if (services.WeCom.Status.Boolean("connected")) throw new InvalidOperationException("界面初始化不应自动连接真实企业微信");
Descendants<Button>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "WeComConnect").StartBringIntoView();
await Task.Delay(400); await CaptureWindowAsync(Path.Combine(output, "wecom-plugin-center.png"));
await InvokeButtonAsync(Descendants<Button>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
await WaitManagementAsync(() => WorkflowEditorPage.Current?.ActiveEditor?.ViewModel.SelectedWorkflow?.PluginVersions.GetValueOrDefault("xfe.wecom") == "3.0.0");
var editor = WorkflowEditorPage.Current!.ActiveEditor!; var flow = editor.ViewModel.SelectedWorkflow!;
if (flow.Enabled != false || flow.Graph.Nodes.Count != 2 || flow.Graph.Nodes.Any(x => x.CapabilityId is "core.if" or "xfe.wecom.quoteReply")) throw new InvalidOperationException("消息接收模板不应预设筛选或回复");
var descriptor = services.Plugins.Installed.Single(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "3.0.0").Manifest.Capabilities.Single(x => x.IsTrigger);
var form = new Controls.TriggerEditor(flow.Graph.Nodes.Single(x => x.Trigger is not null).Trigger!, descriptor, [flow], flow.Id, services.Plugins.Catalog(flow), _ => { });
if (descriptor.Inputs.Count != 0 || form.Children.OfType<ComboBox>().Any() || form.Children.OfType<NumberBox>().Any() || form.Children.OfType<ToggleSwitch>().Any()
|| form.Children.OfType<TextBox>().Any(x => x.Header as string == "插件监听参数")) throw new InvalidOperationException("收到消息节点不应配置业务筛选参数");
if (services.Plugins.Catalog(flow).Keys.Any(x => x.StartsWith("xfe.wecom.filter.", StringComparison.Ordinal))) throw new InvalidOperationException("应使用系统条件分支而不是企微专用筛选节点");
var typedForm = new Controls.TriggerEditor(new() { Kind = TriggerKind.Plugin, Parameters = new() { ["enabled"] = "invalid", ["seconds"] = new System.Text.Json.Nodes.JsonArray(1) } },
new() { IsTrigger = true, Inputs = [new() { Name = "key", Label = "密钥", Type = WorkflowValueType.String, Secret = true }, new() { Name = "enabled", Type = WorkflowValueType.Boolean }, new() { Name = "seconds", Type = WorkflowValueType.Number }] }, [flow], flow.Id, services.Plugins.Catalog(flow), _ => { });
if (typedForm.Children.OfType<PasswordBox>().Any()) throw new InvalidOperationException("触发器凭据不得直接写入工作流");
var typedDialog = new ContentDialog { Title = "触发器参数检查", Content = new ScrollViewer { Content = typedForm, MaxHeight = 500 }, CloseButtonText = "关闭", XamlRoot = App.MainWindow.Content.XamlRoot };
var shown = typedDialog.ShowAsync();
try
{
await WaitManagementAsync(() => typedForm.IsLoaded);
typedForm.Children.OfType<TextBox>().Single(x => x.Header as string == "密钥(凭据引用)").Text = "test-reference";
await WaitManagementAsync(() => typedForm.Definition.Parameters["key"] is System.Text.Json.Nodes.JsonObject secret && secret.String("$secret") == "test-reference");
}
finally { typedDialog.Hide(); await shown; }
await Task.Delay(400); await CaptureWindowAsync(Path.Combine(output, "wecom-template-workflow.png"));
await SmokeWeComTriggerDiscoveryAsync(output);
var legacyFlow = new WorkflowDefinition { Name = "企微升级关闭状态验收", Enabled = true, PluginVersions = new() { ["xfe.wecom"] = "1.0.0" }, Graph = new()
{
Nodes = [new() { Id = "start", CapabilityId = "core.start" }, new() { Id = "send", CapabilityId = "xfe.wecom.send", Parameters = new() { ["content"] = "界面检查,不发送" } }, new() { Id = "end", CapabilityId = "core.end" }],
Edges = [new() { FromNode = "start", ToNode = "send" }, new() { FromNode = "send", ToNode = "end" }]
} };
await services.Workflows.SaveAsync(legacyFlow);
try { await (await WorkflowEditorPage.Current!.OpenAsync(legacyFlow.Id)).SmokeWeComUpgradeAsync(); }
finally { await WorkflowEditorPage.CloseOpenAsync(legacyFlow.Id); }
await WorkflowEditorPage.CloseOpenAsync(flow.Id); navigation.NavigateTo<MainPage>();
await WaitManagementAsync(() => MainPage.Current is { IsLoaded: true }); App.MainWindow.AppWindow.Resize(size);
}
private static async Task SmokeWeComTriggerDiscoveryAsync(string output)
{
var services = AppServices.Current; var flow = WorkflowTemplates.CreateGraph(); flow.Name = "企业微信触发器发现"; flow.Enabled = false; flow.PluginVersions["xfe.wecom"] = "1.0.0";
await services.Workflows.SaveAsync(flow); var hub = WorkflowEditorPage.Current!; var editor = await hub.OpenAsync(flow.Id);
try
{
var search = Descendants<TextBox>(hub).Single(x => x.Name == "PaletteSearch"); search.Text = "企微";
await WaitManagementAsync(() => editor.ViewModel.PaletteRows.OfType<PaletteItem>().Any(x => x.Descriptor.Id == "xfe.wecom.message.received"));
if (flow.PluginVersions["xfe.wecom"] != "1.0.0" || editor.ViewModel.Catalog.ContainsKey("xfe.wecom.message.received")) throw new InvalidOperationException("浏览节点库改变了旧工作流版本锁定");
var item = editor.ViewModel.PaletteRows.OfType<PaletteItem>().Single(x => x.Descriptor.Id == "xfe.wecom.message.received");
if (item.Category != "触发器" || !item.SourceLabel.Contains("企业微信")) throw new InvalidOperationException("企业微信触发器分类或来源标记缺失");
var list = Descendants<ListView>(hub).Single(x => x.Name == "PaletteList"); list.ScrollIntoView(item);
await WaitManagementAsync(() => list.ContainerFromItem(item) is ListViewItem);
var container = (ListViewItem)list.ContainerFromItem(item); var peer = FrameworkElementAutomationPeer.FromElement(container) ?? new ListViewItemAutomationPeer(container);
((IInvokeProvider)peer.GetPattern(PatternInterface.Invoke)).Invoke();
await WaitManagementAsync(() => editor.ViewModel.SelectedWorkflow!.Graph.Nodes.Any(x => x.CapabilityId == item.Descriptor.Id));
if (editor.ViewModel.SelectedWorkflow!.PluginVersions["xfe.wecom"] != "3.0.0" || editor.ViewModel.SelectedWorkflow.Graph.Nodes.Single(x => x.CapabilityId == item.Descriptor.Id).Trigger?.Kind != TriggerKind.Plugin)
throw new InvalidOperationException("从节点库添加企业微信触发器未切换可用版本或生成触发节点");
var triggerForm = Descendants<Controls.TriggerEditor>(editor).Single();
if (triggerForm.Children.OfType<ComboBox>().Any() || triggerForm.Children.OfType<TextBox>().Any(x => x.Header as string == "插件监听参数")) throw new InvalidOperationException("收到消息不能预设发送者或消息类型筛选");
await Task.Delay(200); await CaptureWindowAsync(Path.Combine(output, "wecom-message-trigger-palette.png"));
}
finally { await WorkflowEditorPage.CloseOpenAsync(flow.Id); }
}
}
using Microsoft.UI.Xaml.Automation;
using Microsoft.UI.Xaml.Automation.Peers;
using Microsoft.UI.Xaml.Automation.Provider;
using System.IO.Compression;
using System.Text.Json;
using XFEWorkflow.Abstractions;
using XFEWorkflow.Core.Runtime;
using XFEWorkflow.ViewModels;
using XFEWorkflow.Views;
namespace XFEWorkflow.Services;
internal static partial class UiSmokeTest
{
private static async Task SmokeWeComPanelAsync(string output)
{
var services = AppServices.Current; var navigation = AppShellPage.Current!.ViewModel.NavigationViewService;
var bundled = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "BundledPlugins", "xfe.wecom"), "plugin.json", SearchOption.AllDirectories);
if (bundled.Length != 1 || JsonSerializer.Deserialize<PluginManifest>(await File.ReadAllTextAsync(bundled[0]), WorkflowJson.Options)?.Version != "3.0.0") throw new InvalidOperationException("软件必须只打包完整的企业微信插件");
if (!services.Plugins.Installed.Any(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "1.0.0"))
{
// Reproduce an existing user's legacy installation with the real old assembly.
var standardFile = Path.Combine(services.Plugins.Installed.First(x => x.Manifest.Id == "xfe.http").Directory, "XFEWorkflow.Plugins.Standard.dll");
var standard = System.Reflection.Assembly.LoadFrom(standardFile);
using var resource = standard.GetManifestResourceStream("XFEWorkflow.Plugins.Standard.Manifests.xfe.wecom.json")!;
var legacy = JsonSerializer.Deserialize<PluginManifest>(resource, WorkflowJson.Options)!;
var package = Path.Combine(services.Paths.Temp, "legacy-wecom-ui-fixture.xfeplugin");
try
{
using (var archive = ZipFile.Open(package, ZipArchiveMode.Create))
{ using (var writer = new StreamWriter(archive.CreateEntry("plugin.json").Open())) writer.Write(JsonSerializer.Serialize(legacy, WorkflowJson.Options)); archive.CreateEntryFromFile(standardFile, legacy.Assembly); }
await services.Plugins.InstallAsync(package);
}
finally { if (File.Exists(package)) File.Delete(package); }
}
var size = App.MainWindow.AppWindow.Size; var scale = App.MainWindow.Content.XamlRoot.RasterizationScale;
App.MainWindow.AppWindow.Resize(new((int)(1920 * scale), (int)(1040 * scale)));
navigation.NavigateTo<PluginsPage>(); await WaitManagementAsync(() => Descendants<GridView>(App.MainWindow.Content).Any(x => x.Items.OfType<PluginCardModel>().Any(y => y.Manifest.Id == "xfe.wecom" && y.Manifest.Version == "3.0.0")));
var catalog = Descendants<GridView>(App.MainWindow.Content).Single(); catalog.SelectedItem = catalog.Items.OfType<PluginCardModel>().Single(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "3.0.0");
await WaitManagementAsync(() => Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
if (catalog.Items.OfType<PluginCardModel>().Count(x => x.Manifest.Id == "xfe.wecom") != 1) throw new InvalidOperationException("企业微信仍展示为多个插件");
ComboBox VersionSelector() => Descendants<ComboBox>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "PluginInstalledVersion");
VersionSelector().SelectedItem = VersionSelector().Items.OfType<InstalledPlugin>().Single(x => x.Manifest.Version == "1.0.0");
await WaitManagementAsync(() => VersionSelector().SelectedItem is InstalledPlugin { Manifest.Version: "1.0.0" } && !Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
VersionSelector().SelectedItem = VersionSelector().Items.OfType<InstalledPlugin>().Single(x => x.Manifest.Version == "3.0.0");
await WaitManagementAsync(() => Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
if (catalog.Items.OfType<PluginCardModel>().Count(x => x.Manifest.Id == "xfe.wecom") != 1) throw new InvalidOperationException("切换历史版本产生了重复插件卡片");
foreach (var id in new[] { "WeComConnect", "WeComDisconnect", "WeComStatus", "WeComProbe", "WeComImportLegacy", "WeComSelfTest", "WeComAttempts" })
if (!Descendants<Button>(App.MainWindow.Content).Any(x => AutomationProperties.GetAutomationId(x) == id)) throw new InvalidOperationException("企微管理操作缺失:" + id);
if (services.WeCom.Status.Boolean("connected")) throw new InvalidOperationException("界面初始化不应自动连接真实企业微信");
Descendants<Button>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "WeComConnect").StartBringIntoView();
await Task.Delay(400); await CaptureWindowAsync(Path.Combine(output, "wecom-plugin-center.png"));
await InvokeButtonAsync(Descendants<Button>(App.MainWindow.Content).Single(x => AutomationProperties.GetAutomationId(x) == "WeComTemplate"));
await WaitManagementAsync(() => WorkflowEditorPage.Current?.ActiveEditor?.ViewModel.SelectedWorkflow?.PluginVersions.GetValueOrDefault("xfe.wecom") == "3.0.0");
var editor = WorkflowEditorPage.Current!.ActiveEditor!; var flow = editor.ViewModel.SelectedWorkflow!;
if (flow.Enabled != false || flow.Graph.Nodes.Count != 2 || flow.Graph.Nodes.Any(x => x.CapabilityId is "core.if" or "xfe.wecom.quoteReply")) throw new InvalidOperationException("消息接收模板不应预设筛选或回复");
var descriptor = services.Plugins.Installed.Single(x => x.Manifest.Id == "xfe.wecom" && x.Manifest.Version == "3.0.0").Manifest.Capabilities.Single(x => x.IsTrigger);
var form = new Controls.TriggerEditor(flow.Graph.Nodes.Single(x => x.Trigger is not null).Trigger!, descriptor, [flow], flow.Id, services.Plugins.Catalog(flow), _ => { });
if (descriptor.Inputs.Count != 0 || form.Children.OfType<ComboBox>().Any() || form.Children.OfType<NumberBox>().Any() || form.Children.OfType<ToggleSwitch>().Any()
|| form.Children.OfType<TextBox>().Any(x => x.Header as string == "插件监听参数")) throw new InvalidOperationException("收到消息节点不应配置业务筛选参数");
if (services.Plugins.Catalog(flow).Keys.Any(x => x.StartsWith("xfe.wecom.filter.", StringComparison.Ordinal))) throw new InvalidOperationException("应使用系统条件分支而不是企微专用筛选节点");
var typedForm = new Controls.TriggerEditor(new() { Kind = TriggerKind.Plugin, Parameters = new() { ["enabled"] = "invalid", ["seconds"] = new System.Text.Json.Nodes.JsonArray(1) } },
new() { IsTrigger = true, Inputs = [new() { Name = "key", Label = "密钥", Type = WorkflowValueType.String, Secret = true }, new() { Name = "enabled", Type = WorkflowValueType.Boolean }, new() { Name = "seconds", Type = WorkflowValueType.Number }] }, [flow], flow.Id, services.Plugins.Catalog(flow), _ => { });
if (typedForm.Children.OfType<PasswordBox>().Any()) throw new InvalidOperationException("触发器凭据不得直接写入工作流");
var typedDialog = new ContentDialog { Title = "触发器参数检查", Content = new ScrollViewer { Content = typedForm, MaxHeight = 500 }, CloseButtonText = "关闭", XamlRoot = App.MainWindow.Content.XamlRoot };
var shown = typedDialog.ShowAsync();
try
{
await WaitManagementAsync(() => typedForm.IsLoaded);
typedForm.Children.OfType<TextBox>().Single(x => x.Header as string == "密钥(凭据引用)").Text = "test-reference";
await WaitManagementAsync(() => typedForm.Definition.Parameters["key"] is System.Text.Json.Nodes.JsonObject secret && secret.String("$secret") == "test-reference");
}
finally { typedDialog.Hide(); await shown; }
await Task.Delay(400); await CaptureWindowAsync(Path.Combine(output, "wecom-template-workflow.png"));
await SmokeWeComTriggerDiscoveryAsync(output);
var legacyFlow = new WorkflowDefinition { Name = "企微升级关闭状态验收", Enabled = true, PluginVersions = new() { ["xfe.wecom"] = "1.0.0" }, Graph = new()
{
Nodes = [new() { Id = "start", CapabilityId = "core.start" }, new() { Id = "send", CapabilityId = "xfe.wecom.send", Parameters = new() { ["content"] = "界面检查,不发送" } }, new() { Id = "end", CapabilityId = "core.end" }],
Edges = [new() { FromNode = "start", ToNode = "send" }, new() { FromNode = "send", ToNode = "end" }]
} };
await services.Workflows.SaveAsync(legacyFlow);
try { await (await WorkflowEditorPage.Current!.OpenAsync(legacyFlow.Id)).SmokeWeComUpgradeAsync(); }
finally { await WorkflowEditorPage.CloseOpenAsync(legacyFlow.Id); }
await WorkflowEditorPage.CloseOpenAsync(flow.Id); navigation.NavigateTo<MainPage>();
await WaitManagementAsync(() => MainPage.Current is { IsLoaded: true }); App.MainWindow.AppWindow.Resize(size);
}
private static async Task SmokeWeComTriggerDiscoveryAsync(string output)
{
var services = AppServices.Current; var flow = WorkflowTemplates.CreateGraph(); flow.Name = "企业微信触发器发现"; flow.Enabled = false; flow.PluginVersions["xfe.wecom"] = "1.0.0";
await services.Workflows.SaveAsync(flow); var hub = WorkflowEditorPage.Current!; var editor = await hub.OpenAsync(flow.Id);
try
{
var search = Descendants<TextBox>(hub).Single(x => x.Name == "PaletteSearch"); search.Text = "企微";
await WaitManagementAsync(() => editor.ViewModel.PaletteRows.OfType<PaletteItem>().Any(x => x.Descriptor.Id == "xfe.wecom.message.received"));
if (flow.PluginVersions["xfe.wecom"] != "1.0.0" || editor.ViewModel.Catalog.ContainsKey("xfe.wecom.message.received")) throw new InvalidOperationException("浏览节点库改变了旧工作流版本锁定");
var item = editor.ViewModel.PaletteRows.OfType<PaletteItem>().Single(x => x.Descriptor.Id == "xfe.wecom.message.received");
if (item.Category != "触发器" || !item.SourceLabel.Contains("企业微信")) throw new InvalidOperationException("企业微信触发器分类或来源标记缺失");
var list = Descendants<ListView>(hub).Single(x => x.Name == "PaletteList"); list.ScrollIntoView(item);
await WaitManagementAsync(() => list.ContainerFromItem(item) is ListViewItem);
var container = (ListViewItem)list.ContainerFromItem(item); var peer = FrameworkElementAutomationPeer.FromElement(container) ?? new ListViewItemAutomationPeer(container);
((IInvokeProvider)peer.GetPattern(PatternInterface.Invoke)).Invoke();
await WaitManagementAsync(() => editor.ViewModel.SelectedWorkflow!.Graph.Nodes.Any(x => x.CapabilityId == item.Descriptor.Id));
if (editor.ViewModel.SelectedWorkflow!.PluginVersions["xfe.wecom"] != "3.0.0" || editor.ViewModel.SelectedWorkflow.Graph.Nodes.Single(x => x.CapabilityId == item.Descriptor.Id).Trigger?.Kind != TriggerKind.Plugin)
throw new InvalidOperationException("从节点库添加企业微信触发器未切换可用版本或生成触发节点");
var triggerForm = Descendants<Controls.TriggerEditor>(editor).Single();
if (triggerForm.Children.OfType<ComboBox>().Any() || triggerForm.Children.OfType<TextBox>().Any(x => x.Header as string == "插件监听参数")) throw new InvalidOperationException("收到消息不能预设发送者或消息类型筛选");
await Task.Delay(200); await CaptureWindowAsync(Path.Combine(output, "wecom-message-trigger-palette.png"));
}
finally { await WorkflowEditorPage.CloseOpenAsync(flow.Id); }
}
}