@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
198 lines (197 loc) • 12.9 kB
TypeScript
/**
* @class assertion
* @memberof ui5
*/
export declare class Assertion {
private vlf;
private ErrorHandler;
/**
* @function expectAttributeToBe
* @memberOf ui5.assertion
* @description Expects the passed elements attribute to be the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String} attribute - The attribute to be compared.
* @param {String | Boolean | Number | Object} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectAttributeToBe(selector, "text", "Hello");
*/
expectAttributeToBe(selector: any, attribute: string, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectAttributeToContain
* @memberOf ui5.assertion
* @description Expects the passed elements attribute to contain the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String} attribute - The attribute to be compared.
* @param {String} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectAttributeToContain(selector, "text", "abc");
*/
expectAttributeToContain(selector: any, attribute: string, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectTextToBe
* @memberOf ui5.assertion
* @description Expects the passed elements text attribute to be the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectTextToBe(selector, "Hello");
*/
expectTextToBe(selector: any, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectValueToBe
* @memberOf ui5.assertion
* @description Expects the passed elements value attribute to be the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String | Number} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectValueToBe(selector, "123");
*/
expectValueToBe(selector: any, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectValueToBeDefined
* @memberOf ui5.assertion
* @description Expects the passed elements value to be defined.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @example await ui5.assertion.expectValueToBeDefined(selector);
*/
expectValueToBeDefined(selector: any, index?: number, timeout?: number): Promise<void>;
/**
* @function expectToBeNotEnabled
* @memberOf ui5.assertion
* @description Expects that the element is not enabled to the user.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectToBeNotEnabled(selector);
*/
expectToBeNotEnabled(selector: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<void>;
/**
* @function expectToBeEnabled
* @memberOf ui5.assertion
* @description Expects that the element is enabled to the user.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectToBeEnabled(selector);
*/
expectToBeEnabled(selector: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<void>;
/**
* @function expectValidationError
* @memberOf ui5.assertion
* @description Expects the "valueState" of the element to be "Error".
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectValidationError(selector);
*/
expectValidationError(selector: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectValidationSuccess
* @memberOf ui5.assertion
* @description Expects the valueState of the element to be "None".
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectValidationSuccess(selector);
*/
expectValidationSuccess(selector: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectCssPropertyValueToBe
* @memberOf ui5.assertion
* @description Expects the CSS property value of the passed element to be the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String} cssProperty - The CSS property of the element to compare with.
* @param {String} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there is more than one element visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @example await ui5.assertion.expectCssPropertyValueToBe(selector, "color", "rgb(255, 0, 0)");
*/
expectCssPropertyValueToBe(selector: any, cssProperty: string, compareValue: string, index?: number, timeout?: number): Promise<void>;
/**
* @function expectBindingPathToBe
* @memberOf ui5.assertion
* @description Expects the passed elements attribute binding-path to contain the compare value
* @param {Object} selector - The selector describing the element.
* @param {String} attribute - The attribute to be compared.
* @param {String | String[]} compareValue - The compare value(s).
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectBindingPathToBe(selector, "text", "Hello");
*/
expectBindingPathToBe(selector: any, attribute: string, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<undefined>;
/**
* @function expectBindingContextPathToBe
* @memberOf ui5.assertion
* @description Expects the passed elements binding-context-path to be the compare value.
* @param {Object} selector - The selector describing the element.
* @param {String} attribute - The attribute to be compared.
* @param {String} compareValue - The compare value.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectBindingContextPathToBe(selector, "text", "Hello");
*/
expectBindingContextPathToBe(selector: any, compareValue: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<undefined>;
/**
* @function expectToBeVisible
* @memberOf ui5.assertion
* @description Expects that the element is visible to the user.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectToBeVisible(selector);
*/
expectToBeVisible(selector: any, index?: number, timeout?: number, loadPropertyTimeout?: string | number): Promise<any>;
/**
* @function expectToBeVisibleInViewport
* @memberOf ui5.assertion
* @description Expects that the element is visible in the viewport.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @param {Number} [loadPropertyTimeout = 10000] - The timeout to wait for a specific property to have the given compare value.
* @example await ui5.assertion.expectToBeVisibleInViewport(selector);
*/
expectToBeVisibleInViewport(selector: any, index?: number, timeout?: number): Promise<void>;
/**
* @function expectToBeNotVisible
* @memberOf ui5.assertion
* @description Expects that the element is not visible to the user.
* @param {Object} selector - The selector describing the element.
* @param {Number} [index=0] - The index of the selector (in case there are more than one elements visible at the same time).
* @param {Number} [timeout=30000] - The timeout to wait (ms). Recommendation is to lower the timeout since the element is not expected to show up.
* @example await ui5.assertion.expectToBeNotVisible(selector, 0, 5000);
*/
expectToBeNotVisible(selector: any, index?: number, timeout?: number): Promise<void>;
/**
* @function expectMessageToastTextToBe
* @memberOf ui5.assertion
* @description Expects the message toast with the passed text.
* @param {String} text - The expected text.
* @param {Number} [timeout=30000] - The timeout to wait (ms).
* @example await ui5.assertion.expectMessageToastTextToBe(text);
*/
expectMessageToastTextToBe(text: string, timeout?: number): Promise<void>;
private _getUI5Property;
private _getInnerUI5Property;
private _trimText;
private _throwAttributeError;
}
declare const _default: Assertion;
export default _default;