Narine Poghosyan
Narine Poghosyan

Reputation: 893

How to select text in editor using cypress

I am tester and beginer in Cypress. I have a editor and typing it any text. After typing I want to select my typing text and do with it anything /ex. change a style/

this is my html code

<div class="editor">
    <p> my text </p>
</div>

Does anyone have a way on how to do that?

Upvotes: 3

Views: 2765

Answers (1)

random
random

Reputation: 7891

Set type to {selectall} - https://docs.cypress.io/api/commands/type.html#Week-Inputs

cy.get('.editor').type('{selectall}');

Upvotes: 3

Related Questions