Skip to content

Commit

Permalink
Added XPath for right click (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrote1 authored Apr 10, 2017
1 parent 91d2f5d commit 77e0062
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Xenon.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd" >
<metadata>
<id>Xenon</id>
<version>0.1.23</version>
<version>0.1.25</version>
<title>Xenon</title>
<authors>Liquid Thinking</authors>
<projectUrl>https://github.com/LiquidThinking/Xenon</projectUrl>
Expand All @@ -14,7 +14,7 @@
There are the following pre-built browser automation wrappers:
http://www.nuget.org/packages/Xenon.Selenium/
</description>
<releaseNotes>Added ContainsText in XenonElementsFinder</releaseNotes>
<releaseNotes>Added RightClick support</releaseNotes>
<dependencies>
</dependencies>
</metadata>
Expand Down
14 changes: 14 additions & 0 deletions Xenon/BaseXenonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ public T Click( Func<XenonElementsFinder, XenonElementsFinder> where, AssertionF
customPostWait );
}

/// <summary>
/// Right clicks the element specified
/// By default waits for the element to exist before clicking
/// </summary>
/// <param name="cssSelector">The css selector of the element</param>
/// <param name="customPreWait">Custom action wait upon before clicking to the element</param>
/// <param name="customPostWait">Custom action wait upon after clicking to the element</param>
public T RightClick( Func<XenonElementsFinder, XenonElementsFinder> where, AssertionFunc customPreWait = null, AssertionFunc customPostWait = null )
{
return RunTask( browser => where( new XenonElementsFinder( browser ) ).FindElements().LocateSingleVisibleElement().RightClick(),
customPreWait ?? ( a => a.CustomAssertion( b => where( new XenonElementsFinder( b ) ).FindElements().LocateSingleVisibleElement().IsVisible ) ),
customPostWait );
}

/// <summary>
/// Enters the text into the element specified.
/// By default waits for the element to exist before entering the text
Expand Down

0 comments on commit 77e0062

Please sign in to comment.