Skip to content

ContextMenuItem

contextMenuItem

One can retrieve an item from an open context menu, much like follows:

import { ActivityBar } from 'vscode-extension-tester';
...
const menu = await new ActivityBar().openContextMenu();
const item = await menu.getItem('References');
// if item has no children
await item.select();
// if there is a submenu under the item
const submenu = await item.select();
const parentMenu = item.getParent();
const label = await item.getLabel();