import { WebElement } from "selenium-webdriver"; import { AbstractElement } from "../AbstractElement"; import { ElementWithContexMenu } from "../ElementWithContextMenu"; import { Editor } from "./Editor"; import { EditorAction } from "./EditorAction"; export declare class EditorTabNotFound extends Error { constructor(title: string, group: number); } /** * View handling the open editors */ export declare class EditorView extends AbstractElement { constructor(); /** * Switch to an editor tab with the given title * @param title title of the tab * @param groupIndex zero based index for the editor group (0 for the left most group) * @returns Promise resolving to Editor object */ openEditor(title: string, groupIndex?: number): Promise; /** * Close an editor tab with the given title * @param title title of the tab * @param groupIndex zero based index for the editor group (0 for the left most group) * @returns Promise resolving when the tab's close button is pressed */ closeEditor(title: string, groupIndex?: number): Promise; /** * Close all open editor tabs * @param groupIndex optional index to specify an editor group * @returns Promise resolving once all tabs have had their close button pressed */ closeAllEditors(groupIndex?: number): Promise; /** * Retrieve all open editor tab titles in an array * @param groupIndex optional index to specify an editor group, if left empty will search all groups * @returns Promise resolving to array of editor titles */ getOpenEditorTitles(groupIndex?: number): Promise; /** * Retrieve an editor tab from a given group by title * @param title title of the tab * @param groupIndex zero based index of the editor group, default 0 (leftmost one) * @returns promise resolving to EditorTab object */ getTabByTitle(title: string, groupIndex?: number): Promise; /** * Retrieve all open editor tabs * @param groupIndex index of group to search for tabs, if left undefined, all groups are searched * @returns promise resolving to EditorTab list */ getOpenTabs(groupIndex?: number): Promise; /** * Retrieve the active editor tab * @returns promise resolving to EditorTab object, undefined if no tab is active */ getActiveTab(): Promise; /** * Retrieve all editor groups in a list, sorted left to right * @returns promise resolving to an array of EditorGroup objects */ getEditorGroups(): Promise; /** * Retrieve an editor group with a given index (counting from left to right) * @param index zero based index of the editor group (leftmost group has index 0) * @returns promise resolving to an EditorGroup object */ getEditorGroup(index: number): Promise; /** * Get editor actions of a select editor group * @param groupIndex zero based index of the editor group (leftmost group has index 0), default 0 * @returns promise resolving to list of EditorAction objects */ getActions(groupIndex?: number): Promise; /** * Get editor action of a select editor group, search by title or predicate * @param predicateOrTitle title or predicate to be used in search process * @param groupIndex zero based index of the editor group (leftmost group has index 0), default 0 * @returns promise resolving to EditorAction object if found, undefined otherwise */ getAction(predicateOrTitle: string | ((action: EditorAction) => boolean | PromiseLike), groupIndex?: number): Promise; } /** * Page object representing an editor group */ export declare class EditorGroup extends AbstractElement { private index; constructor(element: WebElement, view?: EditorView, index?: number); /** * Switch to an editor tab with the given title * @param title title of the tab * @returns Promise resolving to Editor object */ openEditor(title: string): Promise; /** * Close an editor tab with the given title * @param title title of the tab * @returns Promise resolving when the tab's close button is pressed */ closeEditor(title: string): Promise; /** * Close all open editor tabs * @returns Promise resolving once all tabs have had their close button pressed */ closeAllEditors(): Promise; /** * Retrieve all open editor tab titles in an array * @returns Promise resolving to array of editor titles */ getOpenEditorTitles(): Promise; /** * Retrieve an editor tab by title * @param title title of the tab * @returns promise resolving to EditorTab object */ getTabByTitle(title: string): Promise; /** * Retrieve all open editor tabs * @returns promise resolving to EditorTab list */ getOpenTabs(): Promise; /** * Retrieve the active editor tab * @returns promise resolving to EditorTab object, undefined if no tab is active */ getActiveTab(): Promise; /** * Retrieve the editor action buttons as EditorActions * @returns promise resolving to list of EditorAction objects */ getActions(): Promise; /** * Find an editor action button by predicate or title * @param predicateOrTitle predicate/title to be used * @returns promise resolving to EditorAction representing the button if found, undefined otherwise */ getAction(predicateOrTitle: string | ((action: EditorAction) => boolean | PromiseLike)): Promise; } /** * Page object for editor view tab */ export declare class EditorTab extends ElementWithContexMenu { constructor(element: WebElement, view: EditorView); /** * Get the tab title as string */ getTitle(): Promise; /** * Select (click) the tab */ select(): Promise; isSelected(): Promise; }