Skip to content

ViewControl

viewControl

Import and find the control through activity bar

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

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

const view = await control.openView();

Close the associated view if open

await control.closeView();

Get the control’s/view’s title

const title = await control.getTitle();

Right click on the control to open the context menu

const menu = await control.openContextMenu();