UNPKG

e2ed

Version:

E2E testing framework over Playwright

28 lines (27 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setDomElementsToClientState = void 0; /** * Set dynamic DOM elements to `reportClientState`. * This client function should not use scope variables (except global functions). * @internal */ const setDomElementsToClientState = ({ afterDomContentLoad = false } = {}) => { let { e2edRightColumnContainer } = reportClientState; if (e2edRightColumnContainer) { return; } e2edRightColumnContainer = document.getElementById('e2edRightColumnContainer') ?? undefined; if (e2edRightColumnContainer) { Object.assign(reportClientState, { e2edRightColumnContainer, }); return; } const messageTail = afterDomContentLoad ? ' after DOMContentLoaded' : '. Probably page not yet completely loaded. Please try click again later'; // eslint-disable-next-line no-console console.error(`Cannot find right column container (id="e2edRightColumnContainer")${messageTail}`); }; exports.setDomElementsToClientState = setDomElementsToClientState;