@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
19 lines • 656 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkCookieExists = void 0;
/**
* Check if a cookie with the given name exists
* @param {String} name The name of the cookie
* @param {String} falseCase Whether or not to check if the cookie exists or not
*/
async function checkCookieExists(name, falseCase) {
const cookies = await browser.getCookies([name]);
if (falseCase) {
expect(cookies).toHaveLength(0);
}
else {
expect(cookies).not.toHaveLength(0);
}
}
exports.checkCookieExists = checkCookieExists;
//# sourceMappingURL=checkCookieExists.js.map