refactor: Applications extension to remove legacy command fallbacks#1233
Open
Dor-bl wants to merge 2 commits into
Open
refactor: Applications extension to remove legacy command fallbacks#1233Dor-bl wants to merge 2 commits into
Dor-bl wants to merge 2 commits into
Conversation
Removed the try-except blocks and legacy command fallbacks in all methods of the Applications extension class. The methods now exclusively use 'mobile:' extension scripts via execute_script. Also removed inheritance from CanRememberExtensionPresence and emptied _add_commands as they are no longer required.
…cks-1308480277413524913
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request simplifies the
Applicationsextension in the Appium Python client by removing legacy fallback code and dependencies on old command execution paths. All app-related operations now use theexecute_scriptmethod directly for W3C extension commands, streamlining the codebase and reducing maintenance overhead.Removal of Legacy/Fallback Logic
Removed all try/except blocks that provided fallbacks to classic Appium commands if W3C extension commands were unavailable, so only the W3C extension path is now used for methods like
background_app,is_app_installed,install_app,remove_app,terminate_app,activate_app, andquery_app_state. [1] [2] [3] [4] [5] [6] [7]Removed the
_add_commandsmethod's registration of legacy Appium commands, as these are no longer needed.Codebase Simplification
Removed imports and class inheritance related to legacy command presence checking and exception handling, such as
CanRememberExtensionPresence,InvalidArgumentException, andUnknownMethodException.Simplified all relevant methods to call
self.execute_scriptdirectly, improving readability and maintainability. [1] [2] [3] [4] [5] [6] [7] [8]