MCPcopy Create free account
hub / github.com/Rello/analytics / saveAndReloadReport

Function saveAndReloadReport

tests/playwright/common.js:448–482  ·  view source on GitHub ↗
(page, reportName, options = {})

Source from the content-addressed store, hash-verified

446}
447
448async function saveAndReloadReport(page, reportName, options = {}) {
449 const {
450 clickSave = true,
451 reloadTimeout = 45000,
452 saveVisibleTimeout = 8000,
453 } = options;
454
455 if (clickSave) {
456 const saveIcon = page.locator('#saveIcon').first();
457 await saveIcon.waitFor({ state: 'visible', timeout: saveVisibleTimeout }).catch(() => {});
458 const isVisible = await saveIcon.isVisible().catch(() => false);
459 if (isVisible) {
460 await saveIcon.click();
461 await waitForSaveComplete(page);
462 }
463 }
464
465 await page.reload({ waitUntil: 'domcontentloaded', timeout: reloadTimeout });
466 await waitForIdle(page, 20000);
467 await dismissAnalyticsOnboarding(page);
468 await waitForIdle(page, 10000);
469
470 if (!reportName) {
471 return;
472 }
473
474 const header = reportHeaderLocator(page);
475 const headerVisible = await header.isVisible().catch(() => false);
476 const headerText = headerVisible ? (await header.innerText()).trim() : '';
477 if (!headerVisible || !headerText.includes(reportName)) {
478 await openExistingReport(page, reportName);
479 return;
480 }
481 await assertReportHeader(page, reportName);
482}
483
484async function openExistingReport(page, reportName) {
485 await ensureNavigationSection(page, 'reports');

Callers 8

21_filter.jsFile · 0.85
23_sort.jsFile · 0.85
22_drilldown.jsFile · 0.85
29_group_top_n.jsFile · 0.85

Calls 7

waitForSaveCompleteFunction · 0.85
waitForIdleFunction · 0.85
reportHeaderLocatorFunction · 0.85
openExistingReportFunction · 0.85
assertReportHeaderFunction · 0.85
firstMethod · 0.80

Tested by

no test coverage detected