@sap_oss/wdio-qmate-service
Version:
[](https://api.reuse.software/info/github.com/SAP/wdio-qmate-service)[](http
86 lines (85 loc) • 4.88 kB
TypeScript
import { Element } from "../../../../@types/wdio";
/**
* @class assertion
* @memberof nonUi5
*/
export declare class Assertion {
private vlf;
private ErrorHandler;
/**
* @function expectAttributeToBe
* @memberOf nonUi5.assertion
* @description Expects the attributes value of the passed element to be the compare value.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @param {String} compareValue - The compare value.
* @param {String} [attribute] - The attribute to compare. If not passed, it will compare the inner HTML content of the element.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectAttributeToBe(element, "Save");
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectAttributeToBe(element, "Save", "title");
*/
expectAttributeToBe(elementOrSelector: Element | string, compareValue: string, attribute?: string): Promise<void>;
/**
* @function expectAttributeToContain
* @memberOf nonUi5.assertion
* @description Expects the attributes value of the passed element to contain the compare value.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @param {String} compareValue - The compare value.
* @param {String} [attribute] - The attribute to compare. If not passed, it will compare the inner HTML content of the element.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectAttributeToContain(element, "Save", "title");
*/
expectAttributeToContain(elementOrSelector: Element | string, compareValue: string, attribute?: string): Promise<any>;
/**
* @function expectValueToBe
* @memberOf nonUi5.assertion
* @description Expects the attributes value of the passed element to be the compare value.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @param {String} compareValue - The compare value.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectValueToBe(element, "Save");
*/
expectValueToBe(elementOrSelector: Element | string, compareValue: string): Promise<void>;
/**
* @function expectCssPropertyValueToBe
* @memberOf nonUi5.assertion
* @description Expects the CSS property value of the passed element to be the compare value.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @param {String} cssProperty - The CSS property of the element to compare with.
* @param {String} compareValue - The compare value.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectCssPropertyValueToBe(element, "color", "rgb(255, 0, 0)");
*/
expectCssPropertyValueToBe(elementOrSelector: Element | string, cssProperty: string, compareValue: string): Promise<void>;
/**
* @function expectTextToBe
* @memberOf nonUi5.assertion
* @description Expects the text of the passed element to be the compare value.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @param {String} compareValue - The compare value.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectTextToBe(element, "Save");
**/
expectTextToBe(elementOrSelector: Element | string, compareValue: string): Promise<void>;
/**
* @function expectToBeVisible
* @memberOf nonUi5.assertion
* @description Expects that the element is visible to the user.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @example const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectToBeVisible(elem);
*/
expectToBeVisible(elementOrSelector: Element | string): Promise<void>;
/**
* @function expectToBeNotVisible
* @memberOf nonUi5.assertion
* @description Expects that the element is not visible to the user.
* @param {Element | string} elementOrSelector - The element or CSS selector describing the element.
* @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 const element = await nonUi5.element.getById("button01");
* await nonUi5.assertion.expectToBeNotVisible(element, 5000);
*/
expectToBeNotVisible(elementOrSelector: Element | string, timeout?: number): Promise<void>;
}
declare const _default: Assertion;
export default _default;