UNPKG

@salesforce/salesforcedx-vscode-test-tools

Version:
60 lines (59 loc) 3.15 kB
import { DefaultTreeItem, Locator, TreeItem, ViewSection, WebElement, Workbench } from 'vscode-extension-tester'; /** * Expands a project in the sidebar explorer view * @param workbench - The VSCode workbench instance * @param projectName - The name of the project to expand * @returns The ViewSection representing the expanded project * @throws Assertion error if sidebar is not displayed */ export declare function expandProjectInSideBar(workbench: Workbench, projectName: string): Promise<ViewSection>; /** * Gets the visible items from a project in the sidebar * @param workbench - The VSCode workbench instance * @param projectName - The name of the project to get items from * @returns Array of visible item labels in the project */ export declare function getVisibleItemsFromSidebar(workbench: Workbench, projectName: string): Promise<string[]>; /** * Gets visible tree view items filtered by a search string * @param workbench - The VSCode workbench instance * @param projectName - The name of the project to get items from * @param searchString - The string to filter items by (items starting with this string will be included) * @returns Array of DefaultTreeItems that match the filter criteria */ export declare function getFilteredVisibleTreeViewItems(workbench: Workbench, projectName: string, searchString: string): Promise<DefaultTreeItem[]>; /** * Gets visible tree view item labels filtered by a search string * @param workbench - The VSCode workbench instance * @param projectName - The name of the project to get items from * @param searchString - The string to filter items by (items starting with this string will be included) * @returns Array of label strings that match the filter criteria */ export declare function getFilteredVisibleTreeViewItemLabels(workbench: Workbench, projectName: string, searchString: string): Promise<string[]>; /** * Finds a child item with the specified name in a tree item * @param defaultTreeItem - The parent tree item to search in * @param name - The exact name of the child item to find * @returns The child TreeItem if found, undefined otherwise */ export declare function getVisibleChild(defaultTreeItem: DefaultTreeItem, name: string): Promise<TreeItem | undefined>; /** * Gets all visible children of a tree item * Similar to DefaultTreeItem.getChildren() but uses getVisibleItems() * @param defaultTreeItem - The parent tree item * @returns Array of visible child TreeItems */ export declare function getVisibleChildren(defaultTreeItem: DefaultTreeItem): Promise<TreeItem[]>; /** * Gets all visible items within a tree * @param treeItem - The tree item to start from * @param locator - The locator to find items * @returns Array of WebElements representing all visible items in the tree */ export declare function getVisibleItems(treeItem: TreeItem, locator: Locator): Promise<WebElement[]>; /** * Verifies that a project has been loaded * @param projectName - The name of the project to verify * @throws Error if the project or force-app folder cannot be found */ export declare function verifyProjectLoaded(projectName: string): Promise<void>;