3

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?

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
sammiepls
  • 1,340
  • 2
  • 13
  • 19

1 Answers1

3

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.

Alex Kamaev
  • 6,198
  • 1
  • 14
  • 29
  • Ah, I am using `contenteditable`. Is there any way for me to get the `shift+enter` combination? – sammiepls Dec 06 '18 at 07:04
  • 3
    For now, we do not have plans to implement this feature. I've prepared a workaround which emulates the described behavior. It works with a simple contenteditable element, but I don't know if it will work in your complex editor.   Please refer to it https://gist.github.com/AlexKamaev/c8834424f2f078f0942b73eaa18661c7 – Alex Kamaev Dec 06 '18 at 08:07
  • Thank you so much again Alex! – sammiepls Dec 06 '18 at 09:28