UNPKG

@nice-digital/wdio-cucumber-steps

Version:

Shared step definitions for Cucumber JS BDD tests in WebdriverIO

19 lines 794 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleModal = void 0; /*! https://github.com/webdriverio/cucumber-boilerplate/blob/master/src/support/action/handleModal.js */ /** * Handle a modal * @param {String} action Action to perform on the modal (accept, dismiss) * @param {String} modalType Type of modal (alertbox, confirmbox, prompt) */ async function handleModal(action, modalType) { let command = action == "accept" ? "acceptAlert" : "dismissAlert"; // Alert boxes can't be dismissed, this causes Chrome to crash during tests if (modalType === "alertbox") { command = "acceptAlert"; } await browser[command](); } exports.handleModal = handleModal; //# sourceMappingURL=handleModal.js.map