samedi 26 septembre 2020

Starting with Cypress; enter text in a summernote editor

I'm starting with Cypress and learning as I go.

I have a form on a page which has a text editor summernote. I'm trying to get that element and type some text into it.

The approaches I've taken do not allow this to happen as Cypress is unable to find the elements.

I've tried:

cy.get(':nth-child(3) > .col-sm-8 > .note-editor > .note-editing-area > .note-editable')
            .type('test intro text');

Which is the path shown when I inspect the element on the test page

cy.get('#productionIntro  .note-editable').type('test intro text');

An alternative using the ID of the text area and the editable class

cy.get('#productionIntro').type('test intro text');

Which is simply tying to get the hidden textarea

How can I select the editor and enter text into it with Cypress?

Aucun commentaire:

Enregistrer un commentaire