Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for left mouse click at a specific point #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/TestStack.White/UIItems/IUIItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ public interface IUIItem : IActionListener, IEquatable<IUIItem>
/// </summary>
void Click();

/// <summary>
/// Performs mouse click at a defined <see cref="Point"/>
/// </summary>
/// <param name="point">Point where to mouse left click</param>
void ClickAt(Point point);

/// <summary>
/// Performs mouse double click at the center of the UI Item
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions src/TestStack.White/UIItems/UIItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,15 @@ public virtual void Click()
PerformIfValid(PerformClick);
}

/// <summary>
/// Implements <see cref="IUIItem.ClickAt"/>
/// </summary>
public virtual void ClickAt(Point point)
{
actionListener.ActionPerforming(this);
mouse.Click(point, actionListener);
}

/// <summary>
/// Implements <see cref="IUIItem.DoubleClick"/>
/// </summary>
Expand Down