MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / clearEditor

Function clearEditor

e2e/utils/editor.ts:25–41  ·  view source on GitHub ↗
({
  page,
  browserName,
  isMobile = false
}: {
  page: Page;
  browserName: string;
  isMobile?: boolean;
})

Source from the content-addressed store, hash-verified

23};
24
25export async function clearEditor({
26 page,
27 browserName,
28 isMobile = false
29}: {
30 page: Page;
31 browserName: string;
32 isMobile?: boolean;
33}) {
34 // TODO: replace with ControlOrMeta when it's supported
35 if (browserName === 'webkit' && !isMobile) {
36 await page.keyboard.press('Meta+a');
37 } else {
38 await page.keyboard.press('Control+a');
39 }
40 await page.keyboard.press('Backspace');
41}

Calls

no outgoing calls

Tested by 3

replaceTextInCodeEditorFunction · 0.72
completeChallengesFunction · 0.72