Skip to content

refactor: Move driver-specific commands to use extensions (part1)#856

Merged
mykola-mokhnach merged 8 commits intoappium:masterfrom
mykola-mokhnach:mobile_exts
May 4, 2023
Merged

refactor: Move driver-specific commands to use extensions (part1)#856
mykola-mokhnach merged 8 commits intoappium:masterfrom
mykola-mokhnach:mobile_exts

Conversation

@mykola-mokhnach
Copy link
Copy Markdown
Contributor

No description provided.

@mykola-mokhnach mykola-mokhnach requested a review from KazuCocoa May 1, 2023 08:45
@KazuCocoa
Copy link
Copy Markdown
Member

I haven't reviewed fully yet, but maybe after merging all parts, probably we should bump the major version (at least minor version) as fallback with try/except. Cloud users for example will have additional command delay forcefully, it would increase users' execution time. it might be not patch version change as users.
Then, probably similar to https://github.com/appium/python-client#quick-migration-guide-from-v1-to-v2 note may be needed. I'll create an issue to do it.

@mykola-mokhnach
Copy link
Copy Markdown
Contributor Author

I've also added several helpers to remember the absence of mobile methods, so the command might be slower just during the very first call. All the further calls should be fast as they don't send unnecessary server requests

Copy link
Copy Markdown
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.

otherwise lgtm

:param ext_name: extension name
:return: self instance for chaining
"""
self._absent_extensions.add(ext_name)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we leave a log here? Perhaps... debug or info?

The main usage is for us. When we get reports by users even if they use the latest driver versions, we maybe should add new extension commands for drivers. Such logs will help to find them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added a log

@mykola-mokhnach mykola-mokhnach merged commit 622f3df into appium:master May 4, 2023
@mykola-mokhnach mykola-mokhnach deleted the mobile_exts branch May 4, 2023 04:27
@chrisgraham24
Copy link
Copy Markdown

chrisgraham24 commented May 15, 2023

Hi,

Is the following error in v2.10.0 related to this change?

E selenium.common.exceptions.WebDriverException: Message: Unknown mobile command "pressKey". Only shell,execEmuConsoleCommand,dragGesture,flingGesture,doubleClickGesture,clickGesture,longClickGesture,pinchCloseGesture,pinchOpenGesture,swipeGesture,scrollGesture,scrollBackTo,scroll,viewportScreenshot,viewportRect,deepLink,startLogsBroadcast,stopLogsBroadcast,acceptAlert,dismissAlert,batteryInfo,deviceInfo,getDeviceTime,changePermissions,getPermissions,performEditorAction,startScreenStreaming,stopScreenStreaming,getNotifications,listSms,type,sensorSet,pushFile,pullFile,pullFolder,deleteFile,isAppInstalled,queryAppState,activateApp,removeApp,terminateApp,installApp,clearApp,startActivity,startService,stopService,broadcast,getContexts,installMultipleApks,unlock,refreshGpsCache,startMediaProjectionRecording,isMediaProjectionRecordingRunning,stopMediaProjectionRecording commands are supported.

I am using "press_keycode" and it is erroring on 2.10.0...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants