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

Read-only API to test context menu items and keybindings of extensions #170406

Closed
symmb opened this issue Jan 2, 2023 · 5 comments
Closed

Read-only API to test context menu items and keybindings of extensions #170406

symmb opened this issue Jan 2, 2023 · 5 comments
Assignees
Labels
feature-request Request for new features or functionality menus Menu items and widget issues

Comments

@symmb
Copy link

symmb commented Jan 2, 2023

For testing extensions it would be nice to have a read-only API to check active context menu items and keybindings. It's already possible to verify the validity of an action triggered by a context menu item or keybinding but there is no way to check if a context menu item or keybinding is active at the right time in a test.

Our best bet right now is verifying the validity of when clauses manually but this can get tedious/error prone in extensions that contribute a large amount of menu items or keybindings or make use of setContext.

I'm not sure what such an API would look like as it would probably require a way to specify what "target" to perform the check on (an open editor, sidebar, etc.) and UI automation is not a goal of the VS Code extension API. It's also kind of a bummer that this API would (probably) only be useful for tests.

@symmb
Copy link
Author

symmb commented Jan 2, 2023

Potentially related:

#10471, which contains a comment about testing keybindings.

#110218, which is about an API for dynamic (sub)menus.

@hediet hediet assigned jrieken and unassigned hediet Jan 3, 2023
@jrieken jrieken added feature-request Request for new features or functionality menus Menu items and widget issues labels Jan 3, 2023
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Jan 3, 2023
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@zimmski
Copy link

zimmski commented Jan 17, 2023

Without this issue, we do not see a way of checking if context menu items exist and work. Are we maybe overlooking an existing API or UI testing approach?

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality menus Menu items and widget issues
Projects
None yet
Development

No branches or pull requests

5 participants