@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
25 lines • 786 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkModal = void 0;
/**
* Check if a modal was opened
* @param {String} modalType The type of modal that is expected (alertbox,
* confirmbox or prompt)
* @param {String} falseState Whether to check if the modal was opened or not
*/
async function checkModal(_modalType, falseState) {
let promptText = "";
try {
promptText = await browser.getAlertText();
if (falseState) {
expect(promptText).not.toBe(null);
}
}
catch (e) {
if (!falseState) {
expect(promptText).toBe(null);
}
}
}
exports.checkModal = checkModal;
//# sourceMappingURL=checkModal.js.map