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

Function waitForThresholdText

tests/playwright/31_options_thresholds.js:34–44  ·  view source on GitHub ↗
(page, expectedText, timeout = 10000)

Source from the content-addressed store, hash-verified

32}
33
34async function waitForThresholdText(page, expectedText, timeout = 10000) {
35 await page.waitForFunction(
36 ({ selector, expected }) => {
37 const texts = Array.from(document.querySelectorAll(selector))
38 .map((node) => (node.textContent || '').replace(/\s+/g, ' ').trim());
39 return texts.includes(expected);
40 },
41 { selector: '#thresholdList .thresholdText', expected: expectedText },
42 { timeout }
43 );
44}
45
46async function waitForThresholdTextGone(page, expectedText, timeout = 10000) {
47 await page.waitForFunction(

Callers 1

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected