react-codemirror icon indicating copy to clipboard operation
react-codemirror copied to clipboard

Testing with selenium

Open SpencerCDixon opened this issue 9 years ago • 1 comments

I've been stuck trying to test this component with webdriver.io for days now. Has anyone successfully been able to do this??

SpencerCDixon avatar Feb 03 '17 16:02 SpencerCDixon

I actually ended up with this solution:

const newValue = '{ "test": "value" }';

$(".ReactCodeMirror").click();
browser.keys("\uE009a\uE009\uE003");
browser.keys(newValue);

So basically, you click in editor, press CTRL+a and backspace (\uE009a\uE009\uE003). Then just type newValue into editor.

wladimiiir avatar May 25 '17 11:05 wladimiiir