wdio-ui5-service
Version:
WebdriverIO plugin for testing UI5 browser-based apps
146 lines • 5.57 kB
TypeScript
export declare const ELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf";
import { wdi5ControlMetadata, wdi5Selector } from "../types/wdi5.types.js";
/**
* This is a bridge object to use from selector to UI5 control,
* can be seen as a generic representation of a UI5 control
*/
export declare class WDI5Control {
_controlSelector: wdi5Selector;
_webElement: WebdriverIO.Element | string | undefined;
_webdriverRepresentation: WebdriverIO.Element;
_metadata: wdi5ControlMetadata;
_wdio_ui5_key: string;
_generatedUI5Methods: Array<string>;
_initialisation: boolean;
_forceSelect: boolean;
_logging: boolean;
_wdioBridge: WebdriverIO.Element;
_generatedWdioMethods: Array<string>;
_domId: string | undefined;
_browserInstance: WebdriverIO.Browser;
constructor(oOptions: any);
init(controlSelector?: wdi5Selector, forceSelect?: boolean): Promise<this>;
/**
* after retrieving the ui5 control and connection this can be false eg. in cases when no DOM element was found by RecordReplay API
* @return {Boolean} whether this control was successfully initialized
*/
isInitialized(): boolean;
getControlInfo(): wdi5ControlMetadata;
setControlInfo(metadata?: wdi5ControlMetadata): wdi5ControlMetadata;
/**
* tries to retrieve the webdriver representation of the current wdi5 control
* @return {WebdriverIO.Element} the webdriver Element
*/
getWebElement(): Promise<WebdriverIO.Element>;
/**
* add convenience to the getWebElement Function
* @returns {WebdriverIO.Element} the webdriver Element
*/
$(): WebdriverIO.Element;
/**
* bridge to UI5 control api "getAggregation"
* @param name name of the aggregation
* @return array of UI5 controls representing the aggregation
*/
getAggregation(name: string): Promise<any[]>;
/**
* enters a text into a UI5 control
* @param text
*/
enterText(text: string): Promise<this>;
/**
* click on a UI5 control
* this works both on a standalone control as well as with the fluent async api
*/
press(): Promise<this>;
/**
* fire a named event on a UI5 control
* @param {String} eventName
* @param {any} oOptions
* @param {WebdriverIO.Element} webElement
*/
fireEvent(eventName: any, oOptions: any, webElement?: string | WebdriverIO.Element): Promise<any>;
/**
* @deprecated -> use isInitialized()
* @return {Boolean}
*/
getInitStatus(): boolean;
/**
* Interact with specific control.
* @param {object} oOptions
* @param {sap.ui.test.RecordReplay.ControlSelector} oOptions.selector - UI5 type
* @param {sap.ui.test.RecordReplay.InteractionType} oOptions.interactionType - UI5 type
* @param {string} oOptions.enterText
* @param {boolean} oOptions.clearTextFirst
*/
private _interactWithControl;
/**
* returns the wdio web element.
* @throws will throw an error when no DOM Element was found
* @return {WebdriverIO.Element} the webdriver Element
*/
private _getWebElement;
/**
* @param id
* @returns
*/
private _renewWebElement;
/**
* retrieve UI5 control representation of a UI5 control's aggregation
*
* @param aControls strings of IDs of aggregation items
* @returns instances of wdi5 class per control in the aggregation
*/
private _retrieveElements;
/**
* retrieve UI5 control representation of a UI5 control's aggregation
*
* @param eControl ID
* @returns instances of wdi5 class per control in the aggregation
*/
private _retrieveElement;
/**
* attaches to the instance of this class the functions given in the parameter sReplFunctionNames
*
* @param sReplFunctionNames
*/
private _attachControlBridge;
private _attachWdioControlBridge;
/**
* runtime - proxied browser-time UI5 controls' method at Node.js-runtime
*
* @param methodName UI5 control method
* @param webElement representation of selected UI5 control in wdio
* @param args proxied arguments to UI5 control method at runtime
*/
private _executeControlMethod;
/**
* retrieve an aggregation's members as UI5 controls
*
* @param aggregationName
* @param webElement
* @throws will throw an error when no webElement was found
* @return {any}
*/
private _getAggregation;
/**
* used to update the wdio control reference
* this can be used to manually trigger an control reference update after a ui5 control rerendering
* this method is also used wdi5-internally to implement the extended forceSelect option
* @param {Boolean} isRefresh whether to treat the incoming call as a refresh attempt on a stale web element
*/
private _renewWebElementReference;
/**
* expose internal API to refresh a stale web element reference
* @param {Boolean} asRefresh whether to treat the incoming call as a refresh attempt on a stale web element
*/
renewWebElementReference(asRefresh?: boolean): Promise<WebdriverIO.Element>;
/**
* retrieve a DOM element via UI5 locator
* @param {sap.ui.test.RecordReplay.ControlSelector} controlSelector
* @return {[WebdriverIO.Element | String, [aProtoFunctions]]} UI5 control or error message, array of function names of this control
*/
private _getControl;
private _writeObjectResultLog;
}
//# sourceMappingURL=wdi5-control.d.ts.map