(page, expectedText, timeout = 10000)
| 32 | } |
| 33 | |
| 34 | async 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 | |
| 46 | async function waitForThresholdTextGone(page, expectedText, timeout = 10000) { |
| 47 | await page.waitForFunction( |
no test coverage detected