Skip to content

ViewControl

github-actions[bot] edited this page May 16, 2024 · 1 revision

viewControl

Look up the ViewControl by title

Import and find the control through activity bar

import { ActivityBar, ViewControl } from 'vscode-extension-tester';
...
// get view control for Explorer
const control: ViewControl = new ActivityBar().getViewControl('Explorer');

Open view

Open the associated view if not already open and get a handler for it

const view = await control.openView();

Close view

Close the associated view if open

await control.closeView();

Get title

Get the control's/view's title

const title = control.getTitle();

Open context menu

Left click on the control to open the context menu

const menu = await control.openContextMenu();