-
Notifications
You must be signed in to change notification settings - Fork 189
BREAKING CHANGE: use extension commands for deprecated endpoints #939
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A breaking change to replace deprecated Appium endpoints with mobile:
extension commands across drivers, helpers, and tests.
- Swap out old network, activity, and device methods for
ExecuteScript("mobile:…")
implementations - Remove obsolete interface and command constants, add new
GetAppState
,DeviceTime
, and updated clipboard/biometric scripts - Update integration tests to call
ExecuteScript
and remove direct use of removed methods
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/integration/Android/Device/SystemTests.cs | Add CanGetSystemTimeTest using new DeviceTime property |
test/integration/Android/Device/NetworkTests.cs | Replace toggles for data/airplane/wifi with mobile:toggleGps |
test/integration/Android/Device/Keys/KeyboardTests.cs | Introduce startCustomTitleActivity helper via mobile:startActivity |
test/integration/Android/Device/App/AppTests.cs | Change driver to AndroidDriver and assert on GetAppState |
test/integration/Android/ConnectionTest.cs | Remove legacy ConnectionType test |
test/integration/Android/AppStringsTest.cs | Update language code from "en" to "ja" in string fetch test |
test/integration/Android/ActivityTest.cs | Swap StartActivity calls for mobile:startActivity + explicit wait |
src/Appium.Net/Appium/iOS/IOSDriver.cs | Add GetAppState via mobile:queryAppState |
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs | Migrate iOS commands (shake, TouchID, clipboard) to mobile: |
src/Appium.Net/Appium/Interfaces/INetworkActions.cs | Remove deprecated toggle methods |
src/Appium.Net/Appium/Interfaces/IInteractsWithApps.cs | Prune old GetAppState signature |
src/Appium.Net/Appium/AppiumDriverCommand.cs | Drop obsolete JSONWP command constants |
src/Appium.Net/Appium/AppiumDriver.cs | Refactor to use ExecuteScript("mobile:…") , add DeviceTime |
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs | Convert helpers to DriverCommand.ExecuteScript for mobile: |
src/Appium.Net/Appium/AppiumCommand.cs | Remove legacy HTTP endpoint definitions |
src/Appium.Net/Appium/Android/Interfaces/IStartsActivity.cs | Delete old StartActivity method signatures |
src/Appium.Net/Appium/Android/AndroidDriver.cs | Remove deprecated methods, add GetAppState |
src/Appium.Net/Appium/Android/AndroidCommandExecutionHelper.cs | Refactor all Android commands to use mobile: script calls |
Comments suppressed due to low confidence (5)
test/integration/Android/Device/Keys/KeyboardTests.cs:83
- Method names in C# should use PascalCase. Rename
startCustomTitleActivity
toStartCustomTitleActivity
.
private void startCustomTitleActivity() {
src/Appium.Net/Appium/Interfaces/IInteractsWithApps.cs:71
- Drivers now implement
GetAppState(string appId)
. Reintroduce this method in theIInteractsWithApps
interface for a consistent API.
}
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs:73
- This method still calls
AppiumCommandExecutionHelper.SetClipboard
. It should callMobileSetClipboard
to match the new mobile script API.
public static void SetClipboardImage(IExecuteMethod executeMethod, Image image)
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs:80
- Similarly, update this overload to use
MobileSetClipboard
instead of the oldSetClipboard
helper.
public static void SetClipboardImage(IExecuteMethod executeMethod, string base64EncodeImage)
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs:88
- The
HideKeyboard
helper ignores thestrategy
parameter and useskeys
instead of the expectedkeyName
orkey
. Update to include bothstrategy
andkeyName
according to themobile:hideKeyboard
spec.
parameters.Add("keys", new List<string>([key]));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces breaking changes by deprecating several legacy mobile commands and updating implementations to use extension commands (mobile: commands) across iOS, Android, and Windows drivers, while also cleaning up redundant whitespace and code. Key changes include:
- Removal of deprecated methods such as ToggleAirplaneMode, ToggleData, ToggleWifi, GetConnectionType, EndTestCoverage, and dual overloads of HideKeyboard.
- Updates in command execution helpers to use new mobile: endpoints (e.g. mobile:hideKeyboard, mobile:queryAppState, mobile:startActivity) and refactoring of related tests.
- Adjustments in the .NET client API and README documentation to reflect these breaking changes.
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/integration/Android/AppStringsTest.cs | Changed language code from "en" to "ja" to verify localized string retrieval. |
test/integration/Android/ActivityTest.cs | Updated test method name and activity start implementation using mobile:startActivity with added wait logic. |
src/Appium.Net/Appium/iOS/IOSDriver.cs | Updated HideKeyboard signature (removing strategy), and switched clipboard commands to MobileSetClipboard/MobileGetClipboard; added GetAppState method. |
src/Appium.Net/Appium/IOSCommandExecutionHelper.cs | Revised mobile command implementations for shake, biometric, clipboard, and fingerprint commands. |
src/Appium.Net/Appium/Windows/WindowsDriver.cs | Updated HideKeyboard and app management commands to use ExecuteScript with mobile commands. |
src/Appium.Net/Appium/AppiumDriverCommand.cs | Removed legacy/deprecated command definitions. |
Other interface and Android driver files | Removed deprecated networking methods and updated activity/clipboard implementations. |
README.md | Updated documentation and migration table details for v8 breaking changes. |
Comments suppressed due to low confidence (3)
test/integration/Android/ActivityTest.cs:55
- [nitpick] Consider refactoring the hardcoded activity name ".ApiDemos" into a constant or configuration variable to improve maintainability.
wait.Until(drv => { return ((AndroidDriver) drv).CurrentActivity == ".ApiDemos"; });
src/Appium.Net/Appium/iOS/IOSDriver.cs:187
- The removal of the strategy parameter in HideKeyboard is a breaking change; confirm that the interface and documentation are updated to reflect the new method signature.
public new void HideKeyboard(string key) =>
src/Appium.Net/Appium/AppiumDriver.cs:238
- [nitpick] Ensure that passing 'null' as the sole argument in HideKeyboard properly triggers the default behavior after the breaking change in its signature.
=> AppiumCommandExecutionHelper.HideKeyboard(this, null);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a breaking change that replaces numerous deprecated Appium endpoint methods with mobile extension commands, removes obsolete interface members and enums, and updates integration tests and documentation to match the new APIs.
- Swap out legacy commands (e.g.,
ToggleWifi
,StartActivity
) formobile:*
extension commands across Android, iOS, and Windows drivers - Remove old interfaces, enums, and constants tied to deprecated methods
- Revise integration tests and README to reflect the new mobile extension usage
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/integration/Android/AppStringsTest.cs | Changed test to retrieve Japanese app strings ("ja" ) |
test/integration/Android/ActivityTest.cs | Replaced multiple StartActivity tests with a single mobile:startActivity scenario |
src/Appium.Net/Appium/iOS/IOSDriver.cs | Added ShakeDevice , updated HideKeyboard , clipboard, and GetAppState methods |
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs | Refactored to use ExecuteScript for shake, TouchID, clipboard, etc. |
src/Appium.Net/Appium/iOS/Enums/HideKeyboardStrategy.cs | Removed obsolete HideKeyboardStrategy enum file |
src/Appium.Net/Appium/Windows/WindowsDriver.cs | Switched HideKeyboard , CloseApp , and LaunchApp to extension calls |
src/Appium.Net/Appium/Interfaces/INetworkActions.cs | Stripped out deprecated network toggle methods |
src/Appium.Net/Appium/Interfaces/IInteractsWithApps.cs | Removed GetAppState from the interface |
src/Appium.Net/Appium/Interfaces/IHidesKeyboard*.cs | Normalized HideKeyboard overloads and removed strategy parameter |
src/Appium.Net/Appium/AppiumDriverCommand.cs | Deleted constants for removed commands |
src/Appium.Net/Appium/AppiumDriver.cs | Redirected built-in methods to mobile:* extension via ExecuteScript |
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs | Overhauled to consolidate mobile:pressKey , mobile:hideKeyboard , clipboard, performance, etc. |
src/Appium.Net/Appium/AppiumCommand.cs | Cleared out legacy AppiumCommand entries for removed endpoints |
src/Appium.Net/Appium/Android/Interfaces/*.cs | Removed old StartActivity , network-connection interfaces |
src/Appium.Net/Appium/Android/AndroidDriver.cs | Dropped legacy activity and network methods, added GetAppState |
src/Appium.Net/Appium/Android/AndroidCommandExecutionHelper.cs | Refactored all Android helper calls to mobile:* scripts |
README.md | Updated v8 section with removed methods and extension command links |
Comments suppressed due to low confidence (5)
test/integration/Android/ActivityTest.cs:43
- [nitpick] The test name
CurrentActivityTest
doesn’t reflect that it’s covering themobile:startActivity
behavior; consider renaming it toStartActivityTest
or similar for clarity.
public void CurrentActivityTest()
README.md:42
- The link URL is missing the 'r' in
uiautomator2-driver
; it currently points touiautomator2-drive
and will 404.
| `StartActivityWithIntent()`, `StartActivity()` | Use [mobile:startActivity](https://github.com/appium/appium-uiautomator2-drive#mobile-startactivity) to build an expected activity |
test/integration/Android/ActivityTest.cs:43
- The previous tests for various
StartActivity
variants (waiting, new app, no close) were removed, leaving only the default case; consider adding tests for all variants to maintain coverage.
public void CurrentActivityTest()
src/Appium.Net/Appium/iOS/IOSDriver.cs:294
- [nitpick] The parameter is named
bundleId
on iOS butappId
in the Android variant; consider standardizing the parameter name for consistency across platforms.
public AppState GetAppState(string bundleId) =>
src/Appium.Net/Appium/AppiumDriver.cs:228
- Previously, when no parameters were provided
args
was omitted; now an empty dictionary is always sent. This changes the RPC payload and may alter server behavior—consider omitting theargs
entry whenparameters.Count == 0
.
return Execute(DriverCommand.ExecuteScript, new Dictionary<string, object> {
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
A breaking-change update replacing legacy Appium commands with unified extension (mobile:
) scripts, removing deprecated methods/interfaces, and updating tests to use the new patterns.
- Remove legacy network, activity, keyboard, clipboard, and coverage methods/interfaces
- Replace direct command calls with
DriverCommand.ExecuteScript
+mobile:
scripts - Update integration tests and README to reflect the new extension-command usage
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/integration/Android/AppStringsTest.cs | Changed test language parameter from "en" to "ja" to align with updated usage |
test/integration/Android/ActivityTest.cs | Refactored tests to call mobile:startActivity and use WebDriverWait for assertions |
src/Appium.Net/Appium/iOS/IOSDriver.cs | Added new extension-method callers (e.g. ShakeDevice , GetAppState ), adjusted HideKeyboard /clipboard methods |
src/Appium.Net/Appium/iOS/IOSCommandExecutionHelper.cs | Overhauled helper to use DriverCommand.ExecuteScript and mobile: scripts |
src/Appium.Net/Appium/iOS/Enums/HideKeyboardStrategy.cs | Removed deprecated strategy enum |
src/Appium.Net/Appium/Windows/WindowsDriver.cs | Updated HideKeyboard , CloseApp , LaunchApp to extension commands |
src/Appium.Net/Appium/Interfaces/INetworkActions.cs | Removed deprecated network toggles |
src/Appium.Net/Appium/Interfaces/IInteractsWithApps.cs | Removed GetAppState signature |
src/Appium.Net/Appium/Interfaces/IHidesKeyboardWithKeyName.cs | Dropped obsolete strategy parameter |
src/Appium.Net/Appium/Interfaces/IHidesKeyboard.cs | Removed old overload for hiding keyboard |
src/Appium.Net/Appium/AppiumDriverCommand.cs | Deleted constants for removed commands |
src/Appium.Net/Appium/AppiumDriver.cs | Replaced command implementations with ExecuteScript |
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs | Massive refactor to use mobile: extension commands |
src/Appium.Net/Appium/AppiumCommand.cs | Purged legacy HTTP endpoints in favor of mobile: |
src/Appium.Net/Appium/Android/Interfaces/IStartsActivity.cs | Removed legacy StartActivity methods |
src/Appium.Net/Appium/Android/Interfaces/IHasNetworkConnection.cs | Deleted network connection interface |
src/Appium.Net/Appium/Android/AndroidDriver.cs | Dropped old network/activity methods; added mobile: calls |
src/Appium.Net/Appium/Android/AndroidCommandExecutionHelper.cs | Refactored to extension scripts, removed deprecated code |
README.md | Documented v8 breaking changes and extension-command mappings |
Comments suppressed due to low confidence (3)
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs:53
- This call recursively invokes
MobileSetClipboard
, causing infinite recursion for URL clipboard content. Replace it with a directexecuteMethod.Execute(DriverCommand.ExecuteScript, ...)
invocation for the URL case.
AppiumCommandExecutionHelper.MobileSetClipboard(executeMethod,ClipboardContentType.Url, Convert.ToBase64String(base64UrlBytes));
src/Appium.Net/Appium/iOS/IOSDriver.cs:294
- [nitpick] Indentation of this method is off by one space compared to surrounding methods. Align it with the class’s standard formatting.
public AppState GetAppState(string bundleId) =>
src/Appium.Net/Appium/Android/AndroidDriver.cs:425
- [nitpick] The key name here (
appId
) differs from the iOS helper (bundleId
). Consider verifying thatmobile:queryAppState
expectsappId
on Android and maintain clear naming for cross-platform consistency.
["appId"] = appId
README.md
Outdated
| `GetConnectionType()` | Get connection state with [mobile:getConnectivity](https://github.com/appium/appium-uiautomator2-driver#mobile-getconnectivity) | | ||
| `EndTestCoverage()` | Already deprecated. | | ||
| `StartActivityWithIntent()`, `StartActivity()` | Use [mobile:startActivity](https://github.com/appium/appium-uiautomator2-drive#mobile-startactivity) to start an expected activity | | ||
| `strategy` argument in `HideKeyboard()` | It worked only deprecated [old ios driver](https://github.com/appium-boneyard/appium-ios-driver) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand that part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a removal which worked only for outdated appium-ios-driver. I'll exclude this from the table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces breaking changes by deprecating legacy endpoint methods and replacing them with new extension commands, while also cleaning up extraneous whitespaces.
- Deprecated methods such as ToggleAirplaneMode, ToggleData, ToggleWifi, GetConnectionType, EndTestCoverage, and StartActivityWithIntent/StartActivity have been removed.
- The PR updates tests and driver implementations to use the new mobile: commands and adjusts documentation in the README accordingly.
Reviewed Changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/integration/Android/AppStringsTest.cs | Updates language parameter used when getting app strings. |
test/integration/Android/ActivityTest.cs | Modifies test cases to use extension commands and updates the test method naming. |
src/Appium.Net/Appium/iOS/IOSDriver.cs | Removes the deprecated strategy parameter in HideKeyboard and adds new commands (e.g., ShakeDevice). |
src/Appium.Net/Appium/AppiumDriver.cs | Reworks BackgroundApp and HideKeyboard implementations to use mobile: commands. |
src/Appium.Net/Appium/AppiumCommandExecutionHelper.cs | Updates command methods to use ExecuteScript with mobile: commands and refines documentation. |
README.md | Updates documentation to indicate the removal of deprecated endpoints and details the new usage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work!
List of changes
This will be a breaking change PR to clarify the change.
BREAKING CHANGES:
ToggleAirplaneMode
,ToggleData
,ToggleWifi
,SetConnectionType
mobile:setConnectivity
to turn on or off the desired connectivity preferenceGetConnectionType
mobile:getConnectivity
to get network connectivity statusEndTestCoverage
mobile:shell
to build shell command by yourselfStartActivityWithIntent
,StartActivity
mobile:startActivity
* to build expected arguments to start an activitystrategy
inHideKeyboard
for iOS UiAutomation which is deprecated so longThis PR removes redundant while spaces in some files as well.
This has method removals also, so I'd expect this PR will bump a major version.
Types of changes
What types of changes are you proposing/introducing to the .NET client?
Put an
x
in the boxes that applyDocumentation
This can be done by navigating to the documentation section on http://appium.io selecting the appropriate command/endpoint and clicking the 'Edit this doc' link to update the C# example
Integration tests
Details
Please provide more details about changes if necessary. You can provide code samples showing how they work and possible use cases if there are new features. Also, you can create gists with pasted C# code samples or put them here using markdown.
About markdown please read Mastering markdown and Writing on GitHub