From a407b5fbb0afe0266c1a01f864143c98b488599d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Su=C3=A1rez?= Date: Wed, 22 Jan 2025 19:42:48 +0100 Subject: [PATCH] [Testing] Updated Appium.WebDriver to v7.0.0 (#27184) * Updated Appium.WebDriver to v7.0.0 * More changes --- .../Controls.TestCases.Android.Tests.csproj | 2 +- .../Controls.TestCases.Mac.Tests.csproj | 2 +- .../TestCases.Shared.Tests/Tests/Issues/Issue19214.cs | 1 - .../Tests/Issues/Issue19214_2.cs | 1 - .../Tests/Issues/Issue19214_3.cs | 1 - .../TestCases.Shared.Tests/Tests/Issues/Issue22715.cs | 1 - .../TestCases.Shared.Tests/Tests/KeyboardScrolling.cs | 1 - .../Controls.TestCases.WinUI.Tests.csproj | 2 +- .../Controls.TestCases.iOS.Tests.csproj | 2 +- .../src/UITest.Appium/Actions/AppiumDeviceActions.cs | 5 ++++- .../src/UITest.Appium/Actions/AppiumScrollActions.cs | 2 -- .../src/UITest.Appium/Actions/AppiumSliderActions.cs | 1 - .../src/UITest.Appium/Actions/AppiumSwipeActions.cs | 1 - src/TestUtils/src/UITest.Appium/HelperExtensions.cs | 10 ++++++++-- src/TestUtils/src/UITest.Appium/UITest.Appium.csproj | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj b/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj index 910898c5d03c..a89c6f97fcf3 100644 --- a/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj +++ b/src/Controls/tests/TestCases.Android.Tests/Controls.TestCases.Android.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj b/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj index 44fc8779d366..8ee114f5a1b0 100644 --- a/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj +++ b/src/Controls/tests/TestCases.Mac.Tests/Controls.TestCases.Mac.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214.cs index 7763aa3c861a..009a4bdcf175 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214.cs @@ -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; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_2.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_2.cs index 9e9fb0c7d1c2..0942870f9fd0 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_2.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_2.cs @@ -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; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_3.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_3.cs index bf91f521a237..a3fe8a707b6c 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_3.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue19214_3.cs @@ -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; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22715.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22715.cs index 4049f8893d1a..48ac8779999f 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22715.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22715.cs @@ -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; diff --git a/src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrolling.cs b/src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrolling.cs index 99b6f31592bc..7f4d38fc8c77 100644 --- a/src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrolling.cs +++ b/src/Controls/tests/TestCases.Shared.Tests/Tests/KeyboardScrolling.cs @@ -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; diff --git a/src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj b/src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj index f89795c40fec..8d1ac79082e5 100644 --- a/src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj +++ b/src/Controls/tests/TestCases.WinUI.Tests/Controls.TestCases.WinUI.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj b/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj index 8c2f4c2b2a77..f80f50c00039 100644 --- a/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj +++ b/src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumDeviceActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumDeviceActions.cs index bf1b9bff02c3..afd4ea7bbd98 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumDeviceActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumDeviceActions.cs @@ -69,7 +69,10 @@ CommandResponse Unlock(IDictionary 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; } diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumScrollActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumScrollActions.cs index 1fa6f5b6378b..d97360249c07 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumScrollActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumScrollActions.cs @@ -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; diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumSliderActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumSliderActions.cs index f7566eb3a2a1..5be700cd0942 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumSliderActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumSliderActions.cs @@ -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; diff --git a/src/TestUtils/src/UITest.Appium/Actions/AppiumSwipeActions.cs b/src/TestUtils/src/UITest.Appium/Actions/AppiumSwipeActions.cs index 2ee05d18d26d..09f0fe8a3698 100644 --- a/src/TestUtils/src/UITest.Appium/Actions/AppiumSwipeActions.cs +++ b/src/TestUtils/src/UITest.Appium/Actions/AppiumSwipeActions.cs @@ -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; diff --git a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs index 5f9c7cb60b0d..d6b97206e176 100644 --- a/src/TestUtils/src/UITest.Appium/HelperExtensions.cs +++ b/src/TestUtils/src/UITest.Appium/HelperExtensions.cs @@ -1615,15 +1615,21 @@ public static void Lock(this IApp app) /// Functionality that's only available on Android and iOS. /// /// Represents the main gateway to interact with an app. + /// This capability supports the following possible values: pin, pinWithKeyEvent, password, pattern. + /// 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). /// Unlock is only supported on . - 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.Empty); + app.CommandExecutor.Execute("unlock", new Dictionary() + { + { "unlockType", unlockType }, + { "unlockKey", unlockKey }, + }); } /// diff --git a/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj b/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj index 08b934d89b4c..ea2061c87a42 100644 --- a/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj +++ b/src/TestUtils/src/UITest.Appium/UITest.Appium.csproj @@ -7,7 +7,7 @@ - +