| 5 | }; |
| 6 | |
| 7 | export const focusEditor = async ({ |
| 8 | page, |
| 9 | isMobile |
| 10 | }: { |
| 11 | page: Page; |
| 12 | isMobile: boolean; |
| 13 | }) => { |
| 14 | if (isMobile) { |
| 15 | const codeBtn = page.getByRole('tab', { name: 'Code' }); |
| 16 | // The outer div intercepts the click action of its children, |
| 17 | // preventing Playwright from verifying if the children actually receive the click. |
| 18 | // In reality, the children do receive the click, so we bypass that check here. |
| 19 | await codeBtn.click({ force: true }); |
| 20 | } |
| 21 | |
| 22 | await getEditors(page).focus(); |
| 23 | }; |
| 24 | |
| 25 | export async function clearEditor({ |
| 26 | page, |