Skip to content
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

BREAKING CHANGE: AndroidDriver to use modern mobile: commands for Lock, IsLocked and Unlock #874

Merged
merged 5 commits into from
Dec 4, 2024

Conversation

Dor-bl
Copy link
Collaborator

@Dor-bl Dor-bl commented Nov 29, 2024

List of changes

  • Replaced deprecated JSONWP commands with mobile: lock, mobile: isLocked, and mobile: unlock extensions.
  • Updated the Lock method to accept an optional seconds parameter for auto-unlock functionality.
  • Updated the Unlock method to support required key and type parameters, with optional strategy and timeoutMs arguments.
  • Improved code robustness with null checks and parameter validation.

Types of changes

What types of changes are you proposing/introducing to the .NET client?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change that adds functionality or value)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • Test fix (non-breaking change that improves test stability or correctness)

Documentation

  • Have you proposed a file change/ PR with Appium to update documentation?

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

  • Have you provided integration tests for your changes? (required for Bugfix, New feature, or Test fix)

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

parameters["seconds"] = seconds.Value;
}

ExecuteScript("mobile: lock", parameters);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add try/except and fallback to the legacy one like https://github.com/appium/python-client/blob/e4f06abf1f6bc302bde373071d1e3c007a67c03a/appium/webdriver/extensions/hw_actions.py#L40-L47 does. Then, maybe the change doesn't need to be a "breaking" one since the existing one will do the same

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "breaking" is more for the unlock method that now requires additional parameters

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, the todo is correct. We haven't decided when we completely remove them, though. I'm good either, just I brought up the idea here

Copy link
Member

@KazuCocoa KazuCocoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Perhaps it would be nice to include similar breaking changes in one release if we have others

@Dor-bl
Copy link
Collaborator Author

Dor-bl commented Dec 2, 2024

I'll try to find some time, sure

@Dor-bl Dor-bl merged commit c15e797 into appium:main Dec 4, 2024
3 checks passed
@Dor-bl Dor-bl deleted the android_lock branch December 4, 2024 21:21
@KazuCocoa KazuCocoa added the size:S contribution size: S label Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BreakingChange size:S contribution size: S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants