JedWatson / react-codemirror

Codemirror Component for React.js
MIT License
1.56k stars 262 forks source link

Testing with selenium #86

Open SpencerCDixon opened 7 years ago

SpencerCDixon commented 7 years ago

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

wladimiiir commented 7 years ago

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.