ViewSection

This is an abstract class for side bar view sections. Most behavior is defined here, but for specifics, check out the specific subtypes.
Lookup
Section titled “Lookup”Get a section handle from an open side bar.
import { SideBarView } from 'vscode-extension-tester';...const section = await new SideBarView().getContent().getSection('workspace');Section Manipulation
Section titled “Section Manipulation”// get the section titleconst title = await section.getTitle();// collapse section if possible, takes an optional timeout in ms (default 1000)await section.collapse();// expand if possible, takes an optional timeout in ms (default 1000)await section.expand();// find if section is expandedconst expanded = await section.isExpanded();Action Buttons
Section titled “Action Buttons”Section header may also contain some action buttons.
// get an action button by labelconst action = (await section.getAction("New File")) as ViewPanelAction;// get all action buttons for the sectionconst actions = await section.getActions();// click an action buttonawait action.click();// open the 'More Actions...' context menu if available, returns undefined otherwiseconst menu = await section.moreActions();Action Buttons - Dropdown
Section titled “Action Buttons - Dropdown”
Note: Be aware that it is not supported on macOS. For more information see Known Issues.
// find an view action button by titleconst action = (await section.getAction("Hello Who...")) as ViewPanelActionDropdown;// open the dropdown for that buttonconst menu = await action.open();// select an item from an opened context menuawait menu.select("Hello a World");(Tree) Items Manipulation
Section titled “(Tree) Items Manipulation”// get all visible items, note that currently not shown on screen will not be retrievedconst visibleItems = await section.getVisibleItems();// find an item with a given label, involves scrolling to items currently not showingconst item = await section.findItem("package.json");// recursively navigate to an item and click it// if the item has children (./src/webdriver/components folder)const children = await section.openItem("src", "webdriver", "components");// if the item is a leafawait section.openItem("src", "webdriver", "components", "AbstractElement.ts");