Link Search Menu Expand Document

Cypress Command: clickCopyToEditorContaining

Summary

cy.clickCopyToEditorContaining(uniqueSubstring) - Find a "Copy to Editor" block containing `uniqueSubstring` and then call `clickCopyToEditor` with it

Parameters

  • uniqueSubstring - A substring within the copy-to-editor block you would like to click that is not contained within any other copy-to-editor block on the page

Example

cy.clickCopyToEditorContaining("printLine");

Waiting

This command will wait until the contents of the file is updated.

Verification

This command will verify that the contents of the copy-to-editor block is contained within the file before continuing.

  • To automatically perform all the actions within the current step, see clickStepActions or clickCurrentStepActions
  • If you would like to shoulder the burden of identifying which copy-to-editor block to click on, see clickCopyToEditor
  • Before calling this command, you must call watchForVsCodeLoaded to ensure the copy-to-editor block is not clicked before VS Code is ready for interactions

Instruction-Guided

This is an instruction-guided command: By using this command to ask Cypress to click on a copy-to-editor block rather than writing directly to a file, you will avoid having to remember to update your tests every time the contents of the copy-to-editor block changes.