UNPKG

e2ed

Version:

E2E testing framework over Playwright

31 lines (30 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.onFirstJsonReportDataLoad = onFirstJsonReportDataLoad; 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 */ function onFirstJsonReportDataLoad() { if (window.location.hash !== '') { return; } const buttonForFailedTestRun = document.querySelector('.retry:not([hidden]) .test-button_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); } }