From 6a0abecba2eb50341f9bb68fec12b9aab157eaef Mon Sep 17 00:00:00 2001 From: Leilei Zhang Date: Mon, 14 Jul 2025 11:53:10 +0800 Subject: [PATCH] add runner --- src/common/UITestAutomation/SessionHelper.cs | 30 +++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/common/UITestAutomation/SessionHelper.cs b/src/common/UITestAutomation/SessionHelper.cs index b12b1f831b..5cee5dcffe 100644 --- a/src/common/UITestAutomation/SessionHelper.cs +++ b/src/common/UITestAutomation/SessionHelper.cs @@ -122,23 +122,31 @@ namespace Microsoft.PowerToys.UITest public void StartExe(string appPath, string[]? args = null) { var opts = new AppiumOptions(); - opts.AddAdditionalCapability("app", appPath); - if (args != null && args.Length > 0) + if (scope == PowerToysModule.PowerToysSettings) { - // Build command line arguments string - string argsString = string.Join(" ", args.Select(arg => + TryLaunchPowerToysSettings(opts); + } + else + { + opts.AddAdditionalCapability("app", appPath); + + if (args != null && args.Length > 0) { - // Quote arguments that contain spaces - if (arg.Contains(' ')) + // Build command line arguments string + string argsString = string.Join(" ", args.Select(arg => { - return $"\"{arg}\""; - } + // Quote arguments that contain spaces + if (arg.Contains(' ')) + { + return $"\"{arg}\""; + } - return arg; - })); + return arg; + })); - opts.AddAdditionalCapability("appArguments", argsString); + opts.AddAdditionalCapability("appArguments", argsString); + } } this.Driver = NewWindowsDriver(opts);