@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
26 lines • 931 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkModalText = void 0;
/**
* Check the text of a modal
* @param {String} modalType The type of modal that is expected
* (alertbox, confirmbox or prompt)
* @param {String} falseState Whether to check if the text matches or not
* @param {String} expectedText The text to check against
*/
async function checkModalText(modalType, falseState, expectedText) {
try {
const text = await browser.getAlertText();
if (falseState) {
expect(text).not.toBe(expectedText);
}
else {
expect(text).toBe(expectedText);
}
}
catch (e) {
fail(`A ${modalType} was not opened when it should have been opened`);
}
}
exports.checkModalText = checkModalText;
//# sourceMappingURL=checkModalText.js.map