DelayBeforePressingKey
This commit is contained in:
parent
ebd2688564
commit
afc880e1c0
|
|
@ -12,6 +12,10 @@ public class ElementActionArgs
|
|||
|
||||
public ElementPosition? Position { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Delay milliseconds before pressing key
|
||||
/// </summary>
|
||||
public int DelayBeforePressingKey { get; set; }
|
||||
public string? PressKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -56,6 +56,10 @@ public partial class PlaywrightWebDriver
|
|||
|
||||
if (action.PressKey != null)
|
||||
{
|
||||
if (action.DelayBeforePressingKey > 0)
|
||||
{
|
||||
await Task.Delay(action.DelayBeforePressingKey);
|
||||
}
|
||||
await locator.PressAsync(action.PressKey);
|
||||
}
|
||||
}
|
||||
|
|
@ -64,6 +68,10 @@ public partial class PlaywrightWebDriver
|
|||
await locator.PressSequentiallyAsync(action.Content);
|
||||
if (action.PressKey != null)
|
||||
{
|
||||
if (action.DelayBeforePressingKey > 0)
|
||||
{
|
||||
await Task.Delay(action.DelayBeforePressingKey);
|
||||
}
|
||||
await locator.PressAsync(action.PressKey);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue