Cypress and Codemirror (react)

Hello everyone! :blush:

I’m currently experimenting with an application, incorporating Codemirror editors (previously used Monaco) alongside Cypress for testing purposes. My approach involves locating DOM elements through CSS selectors using an HTML attribute (“data-loc”). Subsequently, I aim to input text into the editor using Cypress’s ‘type’ function. To achieve this, I need to append the HTML attribute to the ‘contenteditable’ div within CodeMirror. Any insights on how to access that div would be greatly appreciated!

EditorView.contentDOM is the editable element.

1 Like