Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does testcafe support pressKey("shift+enter")?

I am trying to test if pressing the shift+enter keys will result in a newline. I've checked the docs and they do not have this combination listed there; will this combination ever be added in or is it already there and I just missed it?

like image 467
sammiepls Avatar asked Jul 26 '26 20:07

sammiepls


1 Answers

It depends on your editor implementation. If your editor uses a contenteditable element inside, then according to the documentation it supports only the following combinations: 'ctrl+a', 'backspace', 'delete', 'left' and 'right' (only if text within the element is selected).

https://devexpress.github.io/testcafe/documentation/test-api/actions/press-key.html

However, it should work fine with the textarea element.

like image 54
Alex Kamaev Avatar answered Jul 30 '26 10:07

Alex Kamaev