@nice-digital/wdio-cucumber-steps
Version:
Shared step definitions for Cucumber JS BDD tests in WebdriverIO
24 lines • 976 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkCookieContent = void 0;
/**
* Check the content of a cookie against a given value
* @param {String} name The name of the cookie
* @param {String} falseCase Whether or not to check if the value matches or not
* @param {String} expectedValue The value to check against
*/
async function checkCookieContent(name, falseCase, expectedValue) {
const cookie = await browser.getNamedCookie(name);
if (falseCase) {
expect(cookie).not.toHaveValue(expectedValue, {
message: `expected cookie "${name}" not to have value "${expectedValue}"`,
});
}
else {
expect(cookie).toHaveValue(expectedValue, {
message: `expected cookie "${name}" to have value "${expectedValue}"`,
});
}
}
exports.checkCookieContent = checkCookieContent;
//# sourceMappingURL=checkCookieContent.js.map