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

Function waitForNavigationEntryState

tests/playwright/common.js:339–357  ·  view source on GitHub ↗
(page, name, state)

Source from the content-addressed store, hash-verified

337}
338
339async function waitForNavigationEntryState(page, name, state) {
340 const entry = page
341 .locator(`#app-navigation .app-navigation-entry > a[data-name="${name.replace(/"/g, '\\"')}"]`)
342 .filter({ visible: true })
343 .first();
344 if (state === 'visible') {
345 await entry.waitFor({ state: 'visible', timeout: 20000 });
346 return;
347 }
348 await page.waitForFunction(
349 (targetName) => {
350 return !Array.from(document.querySelectorAll('#app-navigation .app-navigation-entry > a')).some((node) => {
351 return (node.textContent || '').trim() === targetName;
352 });
353 },
354 name,
355 { timeout: 20000 }
356 );
357}
358
359async function waitForNavigationEntryExists(page, name) {
360 await page.waitForFunction(

Callers 3

renameNavigationEntryFunction · 0.85
createStoredReportFunction · 0.85
12_group.jsFile · 0.85

Calls 2

filterMethod · 0.80
firstMethod · 0.45

Tested by

no test coverage detected