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

Function openNavigationEntry

tests/playwright/common.js:209–233  ·  view source on GitHub ↗
(page, name)

Source from the content-addressed store, hash-verified

207}
208
209async 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
235async function assertReportHeader(page, reportName) {
236 const header = reportHeaderLocator(page);

Callers 2

openExistingReportFunction · 0.85
createStoredReportFunction · 0.85

Calls 7

ensureNavigationSectionFunction · 0.85
waitForIdleFunction · 0.85
filterMethod · 0.80
countMethod · 0.80
evaluateMethod · 0.80
containsMethod · 0.80
firstMethod · 0.45

Tested by

no test coverage detected