@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
21 lines • 865 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.compareText = void 0;
/**
* Compare the contents of two elements with each other
* @param {String} selector1 Element selector for the first element
* @param {String} falseCase Whether to check if the contents of both
* elements match or not
* @param {String} selector2 Element selector for the second element
*/
async function compareText(selector1, falseCase, selector2) {
const element1 = await $(selector1), text1 = await element1.getText(), element2 = await $(selector2), text2 = await element2.getText();
if (falseCase) {
expect(text1).not.toEqual(text2);
}
else {
expect(text1).toEqual(text2);
}
}
exports.compareText = compareText;
//# sourceMappingURL=compareText.js.map