UNPKG

e2ed

Version:

E2E testing framework over Playwright

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