Skip to content

Commit

Permalink
[Testing] Updated Appium.WebDriver to v7.0.0 (#27184)
Browse files Browse the repository at this point in the history
* Updated Appium.WebDriver to v7.0.0

* More changes
  • Loading branch information
jsuarezruiz authored Jan 22, 2025
1 parent 1ccfcef commit a407b5f
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NUnit.Framework;
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using NUnit.Framework.Legacy;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Appium;
using UITest.Core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ CommandResponse Unlock(IDictionary<string, object> parameters)
{
if (_appiumApp.Driver is AndroidDriver androidDriver)
{
androidDriver.Unlock();
string unlockType = (string)parameters["unlockType"];
string unlockKey = (string)parameters["unlockKey"];

androidDriver.Unlock(unlockType, unlockKey);

return CommandResponse.SuccessEmptyResponse;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.Mac;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Core;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Core;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Interactions;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using UITest.Core;

Expand Down
10 changes: 8 additions & 2 deletions src/TestUtils/src/UITest.Appium/HelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1615,15 +1615,21 @@ public static void Lock(this IApp app)
/// Functionality that's only available on Android and iOS.
/// </summary>
/// <param name="app">Represents the main gateway to interact with an app.</param>
/// <param name="unlockType">This capability supports the following possible values: pin, pinWithKeyEvent, password, pattern.</param>
/// <param name="unlockKey">a valid pin (digits in range 0-9), password (latin characters) or pattern (treat the pattern pins similarly to numbers on a digital phone dial).</param>
/// <exception cref="InvalidOperationException">Unlock is only supported on <see cref="AppiumAndroidApp"/>.</exception>
public static void Unlock(this IApp app)
public static void Unlock(this IApp app, string unlockType = "", string unlockKey = "")
{
if (app is not AppiumAndroidApp && app is not AppiumIOSApp)
{
throw new InvalidOperationException($"Unlock is only supported on AppiumAndroidApp and AppiumIOSApp");
}

app.CommandExecutor.Execute("unlock", ImmutableDictionary<string, object>.Empty);
app.CommandExecutor.Execute("unlock", new Dictionary<string, object>()
{
{ "unlockType", unlockType },
{ "unlockKey", unlockKey },
});
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/TestUtils/src/UITest.Appium/UITest.Appium.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Appium.WebDriver" Version="5.0.0" />
<PackageReference Include="Appium.WebDriver" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit a407b5f

Please # to comment.