UNPKG

e2ed

Version:

E2E testing framework over Playwright

32 lines (31 loc) 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.onFirstJsonReportDataLoad = void 0; const clickOnTestRun_1 = require("./clickOnTestRun"); const clickOnTestRun = clickOnTestRun_1.clickOnTestRun; /** * Handler of loading first part of JSON report data for report page. * This client function should not use scope variables (except global functions). * @internal */ const onFirstJsonReportDataLoad = () => { if (window.location.hash !== '') { return; } const buttonForFailedTestRun = document.querySelector('.retry:not([hidden]) .test-link[data-status="failed"]'); if (!buttonForFailedTestRun) { return; } clickOnTestRun(buttonForFailedTestRun); const buttonOfOpenStep = document.querySelector('.step-expanded[aria-expanded="true"]'); const scrollDelayInMs = 8; if (buttonOfOpenStep) { const { top } = buttonOfOpenStep.getBoundingClientRect(); setTimeout(() => { if (reportClientState.e2edRightColumnContainer !== undefined) { reportClientState.e2edRightColumnContainer.scrollTop = top; } }, scrollDelayInMs); } }; exports.onFirstJsonReportDataLoad = onFirstJsonReportDataLoad;