e2ed
Version:
E2E testing framework over Playwright
29 lines (28 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.clickOnScreenshot = void 0;
/**
* Handler for click on screenshot in step details.
* This base client function should not use scope variables (except other base functions).
* @internal
*/
const clickOnScreenshot = (element) => {
const image = element.firstElementChild;
if (image === null || image.tagName !== 'IMG') {
// eslint-disable-next-line no-console
console.error('Cannot find element <image> in clicked button', element);
return;
}
const screenshotDialogImage = document.getElementById('screenshotDialogImage');
const screenshotDialogTitle = document.getElementById('screenshotDialogTitle');
if (screenshotDialogImage) {
screenshotDialogImage.alt = image.title;
screenshotDialogImage.src = image.src;
screenshotDialogImage.title = image.title;
}
if (screenshotDialogTitle) {
screenshotDialogTitle.textContent = image.title;
}
document.getElementById('screenshotDialog')?.showModal();
};
exports.clickOnScreenshot = clickOnScreenshot;