@freelancercom/blue-harvest
Version:
protractor helpers
25 lines (24 loc) • 1.02 kB
TypeScript
import { WebElement } from 'protractor';
import { PositionalLocator } from './locator_types';
export interface BrowserSideOptions {
allowUnseen?: boolean;
allowCovered?: boolean;
wantZero?: boolean;
enabled?: boolean;
disabled?: boolean;
}
/**
* Retrying Find does several things to improve stability for tests. Throws
* an error if the element is not found. Returns the found WebElement, or
* true if the element was not desired and was not found.
*
* NOTE: We are attempting to deprecate all the extra retries here by hooking
* Pantheon up to the standard task-based system that Protractor uses to ask
* Angular when the page is stable.
*
* Current stability measures:
* - Polling retry until the timeout is hit.
* - Make sure the element is visible for two searches at least 0.5 seconds
* apart.
*/
export declare function retryingFind(locatorChain: ReadonlyArray<PositionalLocator>, timeout: number, description: string, options: BrowserSideOptions): Promise<WebElement | boolean>;