UNPKG

@openfin/automation-helpers

Version:

Helper methods for automation testing in the OpenFin ecosystem

109 lines (108 loc) 3.92 kB
import type { IWebDriverElement } from "../models/IWebDriverElement"; /** * Methods for OpenFin Home object handling. */ export declare class OpenFinHome { /** * Show the home window. * @param timeout The amount of time to wait for the home window to open. * @returns True if the window was found and opened. */ static show(timeout: number): Promise<boolean>; /** * Hide the home window. */ static hide(): Promise<void>; /** * Perform a search on the home page. * @param searchInput The input to search for. * @param timeoutMs The timeout to wait for results. * @param intervalMs The amount of time between checks. */ static search(searchInput: string, timeoutMs?: number, intervalMs?: number): Promise<void>; /** * Clear the search on the home page. */ static searchClear(): Promise<void>; /** * Select a search result from the home page by index. * @param index The index of the item to select. * @param operation Optionally perform the operation on the item. * @returns The element id of the nth item. */ static searchResultByIndex(index: number, operation?: "open" | "select"): Promise<IWebDriverElement | undefined>; /** * Select a search result from the home page by id. * @param id The id of the item to select. * @param operation Optionally perform the operation on the item. * @returns The element id of the item. */ static searchResultById(id: string, operation?: "open" | "select"): Promise<IWebDriverElement | undefined>; /** * Get a list of the search results ids. * @returns The id of the search results. */ static searchResultIds(): Promise<string[]>; /** * Get the id of the selected search result. * @returns The id of the selected search result. */ static searchResultSelectedId(): Promise<string | undefined>; /** * Get the index of the selected search result. * @returns The index of the selected search result. */ static searchResultSelectedIndex(): Promise<number>; /** * Get the details for the selected search result. * @returns The html contents of the selected search result details. */ static searchResultSelectedItem(): Promise<string | undefined>; /** * Get the details for the selected search result. * @returns The html contents of the selected search result details. */ static searchResultSelectedDetails(): Promise<string | undefined>; /** * Open the filters selector. * @returns Nothing. */ static filtersOpen(): Promise<void>; /** * Close the filters selector. * @param ok Close with ok otherwise cancel. * @returns Nothing. */ static filtersClose(ok: boolean): Promise<void>; /** * Get the list of filter ids. * @returns Filter ids. */ static filtersIds(): Promise<string[]>; /** * Set or clear a filter by index. * @param index The index of the filter to set or clear. * @param setOrClear Set or clear the filter. * @returns Nothing. */ static filtersByIndexSet(index: number, setOrClear: boolean): Promise<void>; /** * Get a filter state by index. * @param index The index of the filter to get the state. * @returns True if the filter was set. */ static filtersByIndexGet(index: number): Promise<boolean>; /** * Set or clear a filter by id. * @param id The id of the filter to set or clear. * @param setOrClear Set or clear the filter. * @returns Nothing. */ static filtersByIdSet(id: string, setOrClear: boolean): Promise<void>; /** * Get a filter state by id. * @param id The id of the filter to get the state. * @returns True if the filter was set. */ static filtersByIdGet(id: string): Promise<boolean>; }