diff --git a/src/Infrastructure/BotSharp.Abstraction/Browsing/IWebBrowser.cs b/src/Infrastructure/BotSharp.Abstraction/Browsing/IWebBrowser.cs index ea80e81a..ff2c4a7d 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Browsing/IWebBrowser.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Browsing/IWebBrowser.cs @@ -12,6 +12,7 @@ public interface IWebBrowser Task ActionOnElement(MessageInfo message, ElementLocatingArgs location, ElementActionArgs action); Task LocateElement(MessageInfo message, ElementLocatingArgs location); Task DoAction(MessageInfo message, ElementActionArgs action, BrowserActionResult result); + Task PressKey(MessageInfo message, string key); Task InputUserText(BrowserActionParams actionParams); Task InputUserPassword(BrowserActionParams actionParams); diff --git a/src/Infrastructure/BotSharp.OpenAPI/BotSharpOpenApiExtensions.cs b/src/Infrastructure/BotSharp.OpenAPI/BotSharpOpenApiExtensions.cs index 4d85167f..efad6e6c 100644 --- a/src/Infrastructure/BotSharp.OpenAPI/BotSharpOpenApiExtensions.cs +++ b/src/Infrastructure/BotSharp.OpenAPI/BotSharpOpenApiExtensions.cs @@ -209,7 +209,7 @@ public static class BotSharpOpenApiExtensions app.UseSwagger(); - if (env.IsDevelopment()) + // if (env.IsDevelopment()) { IdentityModelEventSource.ShowPII = true; app.UseSwaggerUI(); diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.cs index 88a10485..4d13e26f 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.cs @@ -1,3 +1,4 @@ + namespace BotSharp.Plugin.WebDriver.Drivers.PlaywrightDriver; public partial class PlaywrightWebDriver : IWebBrowser @@ -68,4 +69,13 @@ public partial class PlaywrightWebDriver : IWebBrowser { _instance.SetServiceProvider(_services); } + + public async Task PressKey(MessageInfo message, string key) + { + var page = _instance.GetPage(message.ContextId); + if (page != null) + { + await page.Keyboard.PressAsync(key); + } + } }