I am attempting to edit a query on a page in a web application that uses a CodeMirror component. I am using nightwatchjs with selenium in chrome for the test. I can't set the underlying textarea element as it is not visible. Nightwatchjs setValue
method doesn't work as the query is in an editable div.
Example Attempt:
module.exports = {
'Testing save code change' : function (browser) {
browser
.url("http://codemirror.net/index.html")
.waitForElementVisible("#demo", 3000)
.waitForElementVisible('.CodeMirror-code div:nth-child(3) .cm-string', 3000)
.setValue('.CodeMirror-code div:nth-child(3) .cm-string', 'New String');
}
};
Can anyone suggest an approach that will work?