17

I'm looking to test a text editor like https://github.com/brijeshb42/medium-draft using Cypress. But I can't find a way to select text using it. Does anyone have a clue on how to do that?

I'd have to select a specific text range in order for the test to be effective.

SandroMarques
  • 6,070
  • 1
  • 41
  • 46
yamadapc
  • 273
  • 1
  • 3
  • 8

1 Answers1

36

The commented answer above was the clue I needed, but it needs a couple tweaks (at least as of the version I'm using: v3.1.5). The link has all the info, but the answer should be as follows

cy.type('{selectall}')

Note that it's ".type()" instead of ".text()" and the escape sequence is quoted...

Mike
  • 916
  • 12
  • 14