Skip to content

Commit

Permalink
break: ExecuteAsync() under the hood implementation after bumping to …
Browse files Browse the repository at this point in the history
…Selenium 4.23 (#804)

* Update AppiumDriver.cs

* Update AppiumCommandExecutor.cs

* Update Appium.Net.csproj

* Revert "Update Appium.Net.csproj"

This reverts commit bb0308a.

* Revert "Update AppiumCommandExecutor.cs"

This reverts commit c2ebe40.

* bump to selenium 4.23, added executeasync passthrough impl

* Revert "Update AppiumDriver.cs"

This reverts commit f7854e3.

* whoops, missing namespace

* fliped around logic for Execute and ExecuteAsync, Execute now passes through to ExecuteAsync

* fixed execute and executeasync

* Update src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs

Co-authored-by: Dor Blayzer <[email protected]>

* Update src/Appium.Net/Appium.Net.csproj

Co-authored-by: Dor Blayzer <[email protected]>

---------

Co-authored-by: Dor Blayzer <[email protected]>
  • Loading branch information
kelmelzer and Dor-bl authored Jul 28, 2024
1 parent 052489b commit c9c4913
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Appium.Net/Appium.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Selenium.Support" Version="4.21.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.21.0" />
<PackageReference Include="Selenium.Support" Version="4.23.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
</ItemGroup>
<ItemGroup>
Expand Down
8 changes: 7 additions & 1 deletion src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using OpenQA.Selenium.Remote;
using System;
using System.Threading.Tasks;

namespace OpenQA.Selenium.Appium.Service
{
Expand Down Expand Up @@ -54,13 +55,18 @@ internal AppiumCommandExecutor(AppiumLocalService service, TimeSpan timeForTheSe
}

public Response Execute(Command commandToExecute)
{
return Task.Run(() => ExecuteAsync(commandToExecute)).GetAwaiter().GetResult();
}

public async Task<Response> ExecuteAsync(Command commandToExecute)
{
Response result = null;

try
{
bool newSession = HandleNewSessionCommand(commandToExecute);
result = RealExecutor.Execute(commandToExecute);
result = await RealExecutor.ExecuteAsync(commandToExecute).ConfigureAwait(false);
if (newSession)
{
RealExecutor = UpdateExecutor(result, RealExecutor);
Expand Down

0 comments on commit c9c4913

Please sign in to comment.