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

Function assertSimulationData

tests/playwright/common.js:743–756  ·  view source on GitHub ↗
(page, expectedText)

Source from the content-addressed store, hash-verified

741}
742
743async function assertSimulationData(page, expectedText) {
744 await page.locator('#analyticsDialogContainer').first().waitFor({ state: 'visible', timeout: 30000 });
745 const simulation = page.locator('#simulationData').first();
746 await simulation.waitFor({ state: 'attached', timeout: 30000 });
747 if (!(await simulation.isVisible())) {
748 await page.locator('.datasourcePreviewRaw summary').click();
749 }
750 const response = JSON.parse(await simulation.innerText());
751 const actual = JSON.stringify(response.mappingPreview !== undefined
752 ? {data: response.data, mappingPreview: response.mappingPreview} : response.data, null, 2);
753 if (actual !== expectedText) {
754 throw new Error(`Simulation data mismatch. Expected "${expectedText}", got "${actual}"`);
755 }
756}
757
758async function closeAnalyticsDialog(page) {
759 await clickFirst(

Calls 3

isVisibleMethod · 0.80
firstMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected