( page: Page, os: "mac" | "linux" = "linux", )
| 16 | } |
| 17 | |
| 18 | export async function copyPasteAllExternal( |
| 19 | page: Page, |
| 20 | os: "mac" | "linux" = "linux", |
| 21 | ) { |
| 22 | const modifierKey = os === "mac" ? "Meta" : "Control"; |
| 23 | await page.keyboard.press(`${modifierKey}+A`); |
| 24 | await page.keyboard.press(`${modifierKey}+C`); |
| 25 | await focusOnEditor(page); |
| 26 | |
| 27 | const pasteZone = page.locator(PASTE_ZONE_SELECTOR); |
| 28 | await pasteZone.click(); |
| 29 | await page.keyboard.press(`${modifierKey}+V`); |
| 30 | |
| 31 | return await pasteZone.inputValue(); |
| 32 | } |
| 33 | |
| 34 | export function removeClassesFromHTML(html: string) { |
| 35 | return html.replace(/class="\S*"\s/g, ""); |
no test coverage detected