Skip to content

Commit 35bba6a

Browse files
committed
[dotnet] implement a way to reset Action builder sequences after perform is called
1 parent 2259f63 commit 35bba6a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

‎dotnet/src/webdriver/Interactions/ActionBuilder.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ public IList<ActionSequence> ToActionSequenceList()
6666
return new List<ActionSequence>(this.sequences.Values).AsReadOnly();
6767
}
6868

69+
/// <summary>
70+
/// Resets the list of sequences.
71+
/// </summary>
72+
public void ClearSequences()
73+
{
74+
this.sequences = new Dictionary<InputDevice, ActionSequence>();
75+
}
76+
6977
/// <summary>
7078
/// Returns a string that represents the current <see cref="ActionBuilder"/>.
7179
/// </summary>

‎dotnet/src/webdriver/Interactions/Actions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ public IAction Build()
483483
public void Perform()
484484
{
485485
this.actionExecutor.PerformActions(this.actionBuilder.ToActionSequenceList());
486+
this.actionBuilder.ClearSequences();
486487
}
487488

488489
/// <summary>

0 commit comments

Comments
 (0)