(page, name)
| 207 | } |
| 208 | |
| 209 | async function openNavigationEntry(page, name) { |
| 210 | const links = page.locator(`#app-navigation .app-navigation-entry > a[data-name="${name.replace(/"/g, '\\"')}"]`); |
| 211 | await links.first().waitFor({ state: 'attached', timeout: 20000 }); |
| 212 | |
| 213 | let link = links.filter({ visible: true }).first(); |
| 214 | if (!(await link.count())) { |
| 215 | await ensureNavigationSection(page, 'reports'); |
| 216 | link = links.filter({ visible: true }).first(); |
| 217 | } |
| 218 | if (!(await link.count())) { |
| 219 | link = links.first(); |
| 220 | // Reveal nested reports through the same folder controls used by users. |
| 221 | const ancestors = link.locator('xpath=ancestor::li[contains(concat(" ", normalize-space(@class), " "), " collapsible ")]'); |
| 222 | for (let index = 0; index < await ancestors.count(); index += 1) { |
| 223 | const ancestor = ancestors.nth(index); |
| 224 | if (!await ancestor.evaluate(node => node.classList.contains('open'))) { |
| 225 | await ancestor.locator(':scope > .app-navigation-entry > a').click(); |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | await link.waitFor({ state: 'visible', timeout: 20000 }); |
| 231 | await link.click(); |
| 232 | await waitForIdle(page, 15000); |
| 233 | } |
| 234 | |
| 235 | async function assertReportHeader(page, reportName) { |
| 236 | const header = reportHeaderLocator(page); |
no test coverage detected