UNPKG

e2ed

Version:

E2E testing framework over Playwright

21 lines (20 loc) 848 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDocumentCookie = void 0; const createClientFunction_1 = require("../../createClientFunction"); const asserts_1 = require("../asserts"); const log_1 = require("../log"); let clientGetDocumentCookie; /** * Get current document cookie. */ const getDocumentCookie = async () => { if (clientGetDocumentCookie === undefined) { clientGetDocumentCookie = (0, createClientFunction_1.createClientFunction)(() => document.cookie, { name: 'getDocumentCookie' }); } const cookie = await clientGetDocumentCookie(); (0, asserts_1.assertValueIsDefined)(cookie, 'cookie is defined'); (0, log_1.log)('Get current document cookie', { cookie }, 8 /* LogEventType.InternalUtil */); return cookie; }; exports.getDocumentCookie = getDocumentCookie;