| 44 | } |
| 45 | |
| 46 | async function waitForThresholdTextGone(page, expectedText, timeout = 10000) { |
| 47 | await page.waitForFunction( |
| 48 | ({ selector, expected }) => { |
| 49 | const texts = Array.from(document.querySelectorAll(selector)) |
| 50 | .map((node) => (node.textContent || '').replace(/\s+/g, ' ').trim()); |
| 51 | return !texts.includes(expected); |
| 52 | }, |
| 53 | { selector: '#thresholdList .thresholdText', expected: expectedText }, |
| 54 | { timeout } |
| 55 | ); |
| 56 | } |
| 57 | |
| 58 | async function createThreshold(page, { columnLabel, value, severity, coloring = 'value', option = '=' }) { |
| 59 | await page.locator('#thresholdDimension').selectOption({ label: columnLabel }); |