-
-
Notifications
You must be signed in to change notification settings - Fork 354
feat: retrieve commands and execute methods from active extensions #2414
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
base: main
Are you sure you want to change the base?
Conversation
… result also remove handling for notes and driver-specific command exclusion
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 enhances the Commands tab to dynamically retrieve and execute commands/methods from active Appium drivers and plugins, replacing the static command list for Appium 2.16.0+.
Key changes:
- Introduced dynamic command retrieval using
getAppiumCommandsandgetAppiumExtensionsendpoints - Added utilities for transforming driver responses and filtering methods
- Implemented a searchable interface with separate tabs for commands and execute methods
- Maintained backward compatibility with a static fallback for older Appium versions
Reviewed Changes
Copilot reviewed 16 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
app/common/renderer/utils/commands-tab.js |
New utility functions for parsing, filtering, and transforming command/method maps from driver responses |
test/unit/utils-commands-tab.spec.js |
Comprehensive test suite covering the new utility functions |
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx |
Refactored to support dynamic command loading with parameter handling |
app/common/renderer/components/SessionInspector/CommandsTab/MethodMapCommandsList.jsx |
New component for rendering dynamic command lists with search and filtering |
app/common/renderer/components/SessionInspector/CommandsTab/StaticCommandsList.jsx |
Extracted static command list for backward compatibility |
app/common/renderer/constants/commands.js |
Added mappings for Appium-to-WDIO command names and mismatched parameter formats |
docs/session-inspector/commands.md |
Updated documentation explaining dynamic command retrieval and limitations |
docs/quickstart/requirements.md |
Updated recommended driver versions to latest major releases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx
Outdated
Show resolved
Hide resolved
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx
Outdated
Show resolved
Hide resolved
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx
Outdated
Show resolved
Hide resolved
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx
Outdated
Show resolved
Hide resolved
KazuCocoa
left a comment
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.
(I haven't fully walked through the PR yet, but just a 🦶)
app/common/renderer/components/SessionInspector/CommandsTab/Commands.jsx
Outdated
Show resolved
Hide resolved
| return mapped.filter((v) => !isEmptyObject(v)); | ||
| const recurse = (arr) => arr.map(deepFilterEmpty); | ||
| const clean = (arr) => arr.filter(_.negate(isEmptyObject)); | ||
| const recurseAndClean = _.flow([recurse, clean]); |
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.
❤️
| return _.pickBy(mapped, (v) => !isEmptyObject(v)); | ||
| const recurse = (obj) => _.mapValues(obj, deepFilterEmpty); | ||
| const clean = (obj) => _.pickBy(obj, _.negate(isEmptyObject)); | ||
| const recurseAndClean = _.flow([recurse, clean]); |
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.
maybe this part could be extracted to avoid duplication
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.
I think this is fine, since it's only 2 lines that are only duplicated once
This is a major enhancement to the Commands tab, adding the ability to retrieve the active driver's supported commands directly from the driver, and generate the visible command buttons from this response. Note that since the Inspector relies on WDIO for running any command, the visible commands are filtered only to those supported by WDIO.
Many other related enhancements are also included:
Functionality was tested on Appium 3.1.0, 2.19.0 and 2.15.0, with UiAutomator2 and XCUITest drivers.
Here's a brief demo:
commands-tab.mp4