UNPKG

e2ed

Version:

E2E testing framework over Playwright

28 lines (27 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clickOnRetry = void 0; /** * Handler for click on choose Retry button. * This base client function should not use scope variables (except other base functions). * @internal */ const clickOnRetry = (element) => { const chosenRetryId = element.dataset['retry']; const retry = Number(chosenRetryId?.match(/\d+/)?.[0]); const allRetryElements = document.querySelectorAll('.retry'); for (const retryElement of allRetryElements) { retryElement.hidden = retryElement.id !== chosenRetryId; } const previousChosenRetryButton = document.querySelector('.retry-link[aria-current="true"]'); if (previousChosenRetryButton) { previousChosenRetryButton.ariaCurrent = null; } // eslint-disable-next-line no-param-reassign element.ariaCurrent = 'true'; const leftSection = document.querySelector('.column-2'); if (leftSection) { leftSection.ariaLabel = `Retry ${retry}`; } }; exports.clickOnRetry = clickOnRetry;