(page: Page)
| 18 | }; |
| 19 | |
| 20 | const prepareFirstFrame = async (page: Page): Promise<void> => { |
| 21 | const iframe = page.locator('iframe').first(); |
| 22 | await expect(iframe).toBeVisible(); |
| 23 | const frame = await getFirstFrame(page); |
| 24 | if (frame == null) { |
| 25 | return; |
| 26 | } |
| 27 | await frame.waitForLoadState(); |
| 28 | const {height, width} = await frame.evaluate(() => { |
| 29 | const {documentElement, body} = document; |
| 30 | return { |
| 31 | height: Math.max( |
| 32 | documentElement.clientHeight, |
| 33 | documentElement.scrollHeight, |
| 34 | body?.scrollHeight ?? 0, |
| 35 | ), |
| 36 | width: Math.max( |
| 37 | documentElement.clientWidth, |
| 38 | documentElement.scrollWidth, |
| 39 | body?.scrollWidth ?? 0, |
| 40 | ), |
| 41 | }; |
| 42 | }); |
| 43 | await iframe.evaluate( |
| 44 | (element, {height, width}) => { |
| 45 | element.style.height = `${height}px`; |
| 46 | element.style.maxHeight = 'none'; |
| 47 | element.style.width = `${width}px`; |
| 48 | element.style.maxWidth = 'none'; |
| 49 | element.style.border = '0'; |
| 50 | element.style.outline = '0'; |
| 51 | element.style.boxShadow = 'none'; |
| 52 | element.style.overflow = 'hidden'; |
| 53 | }, |
| 54 | {height: Math.max(height, FRAMED_DOC_SHOT_MIN_HEIGHT), width}, |
| 55 | ); |
| 56 | }; |
| 57 | |
| 58 | const applyDocShotStyle = async ( |
| 59 | page: Page, |
no test coverage detected
searching dependent graphs…