(
page: Page,
shot: {fixedText?: string; fixedTextSelector?: string},
)
| 103 | }; |
| 104 | |
| 105 | const stabilizeDocShot = async ( |
| 106 | page: Page, |
| 107 | shot: {fixedText?: string; fixedTextSelector?: string}, |
| 108 | ): Promise<void> => { |
| 109 | if (shot.fixedText == null || shot.fixedTextSelector == null) { |
| 110 | return; |
| 111 | } |
| 112 | const frame = await getFirstFrame(page); |
| 113 | await frame?.evaluate( |
| 114 | ({selector, text}) => { |
| 115 | const maxTimerId = window.setTimeout(() => {}, 0); |
| 116 | for (let id = 0; id <= maxTimerId; id++) { |
| 117 | clearInterval(id); |
| 118 | clearTimeout(id); |
| 119 | } |
| 120 | const element = document.querySelector<HTMLElement>(selector); |
| 121 | if (element != null) { |
| 122 | element.textContent = text; |
| 123 | } |
| 124 | }, |
| 125 | {selector: shot.fixedTextSelector, text: shot.fixedText}, |
| 126 | ); |
| 127 | }; |
| 128 | |
| 129 | const waitForDocShotImages = async ( |
| 130 | page: Page, |
no test coverage detected
searching dependent graphs…