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

Function createStoredReport

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

Source from the content-addressed store, hash-verified

489}
490
491async function createStoredReport(page, reportName, reportSubheader, options = {}) {
492 const {
493 dimension1 = 'Column 1',
494 dimension2 = 'Column 2',
495 visualization = 'table',
496 } = options;
497
498 await clickFirst(
499 page,
500 ['#newReportButton', 'a#newReportButton', 'a:has-text("New report")', 'a:has-text("New")'],
501 'new report button'
502 );
503
504 const wizardOpenedDirectly = await page
505 .locator('#wizardNewName')
506 .first()
507 .isVisible()
508 .catch(() => false);
509 if (!wizardOpenedDirectly) {
510 await clickFirst(
511 page,
512 ['#newMenuReport', 'a#newMenuReport', 'a:has-text("Report")'],
513 'new menu report'
514 );
515 }
516
517 await clickFirst(
518 page,
519 ['#wizardNewTemplateOwnReport', 'button:has-text("Own report")', 'button:has-text("Eigenen Bericht")'],
520 'wizard own report'
521 );
522 await fillRequired(page, '#wizardNewName', reportName, 'wizard report name');
523 await fillRequired(page, '#wizardNewSubheader', reportSubheader, 'wizard report subheader');
524 await clickFirst(page, ['#wizardNext'], 'wizard next from basics');
525
526 await clickFirst(page, ['#wizardNewTypeStored', 'button:has-text("Stored Data")'], 'wizard stored data');
527 await clickFirst(
528 page,
529 ['#wizardNewTypeStoredNew', 'button:has-text("New dataset")', '#wizardNewTypeStoredDataset'],
530 'wizard stored dataset mode'
531 );
532 await fillRequired(page, '#wizardNewDimension1', dimension1, 'dimension 1');
533 await fillRequired(page, '#wizardNewDimension2', dimension2, 'dimension 2');
534 await clickFirst(page, ['#wizardNext'], 'wizard next from data step');
535
536 if (visualization === 'chart') {
537 await clickFirst(
538 page,
539 [
540 '#chartBar',
541 'label[for="chartBar"]',
542 ],
543 'bar visualization'
544 );
545 } else {
546 await clickFirst(
547 page,
548 [

Callers 4

openOrCreateStoredReportFunction · 0.85
14_add_del_data.jsFile · 0.85

Calls 10

clickFirstFunction · 0.85
fillRequiredFunction · 0.85
waitForIdleFunction · 0.85
reportHeaderLocatorFunction · 0.85
ensureNavigationSectionFunction · 0.85
openNavigationEntryFunction · 0.85
assertReportHeaderFunction · 0.85
firstMethod · 0.80

Tested by

no test coverage detected