(page)
| 22 | const reportName = buildUniqueName('Playwright Regression', process.env.REPORT_NAME); |
| 23 | |
| 24 | async function clearFiltersAndReload(page) { |
| 25 | const cancel = page.locator('#analyticsDialogBtnCancel'); |
| 26 | if (await cancel.isVisible()) await cancel.click(); |
| 27 | const buttons = page.locator('.filterVisualizationRemove'); |
| 28 | while (await buttons.count()) { |
| 29 | const count = await buttons.count(); |
| 30 | await buttons.first().click(); |
| 31 | await page.waitForFunction(previousCount => |
| 32 | document.querySelectorAll('.filterVisualizationRemove').length < previousCount |
| 33 | && !OCA.Analytics.currentXhrRequest, count); |
| 34 | } |
| 35 | await saveAndReloadReport(page, reportName); |
| 36 | const savedFilterCount = await page.evaluate(() => |
| 37 | Object.keys(OCA.Analytics.currentReportData.options.filteroptions?.filter || {}).length); |
| 38 | if (savedFilterCount !== 0 || await buttons.count()) { |
| 39 | throw new Error('Filter cleanup did not persist after Save and reload'); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | (async () => { |
| 44 | const browser = await chromium.launch({ headless: config.headless }); |
no test coverage detected