javascript - CKEditor + Protractor: Testing with Protractor can't find CKEditor instance -
i using protractor non-angular page , wanting find ckeditor instance on page set data for. can in chrome console via:
ckeditor.instances.html_editor.setdata("hello")
in test page, have code below:
it('should enter text in editor successfully', function() { var composerpage = new composerpage(); browser.executescript('return window.ckeditor'); window.ckeditor.instances.html_editor.setdata( 'hello' ); });
however, error returned is:
error: failed: cannot read property 'instances' of undefined
i've had @ stack overflow question here: protractor: how access global variables have inside our application? didn't me unstuck.
any suggestions how can define ckeditor instance , set data helpful!
use browser.executescript()
set editor's data:
var value = 'hello'; browser.executescript(function (arguments) { window.ckeditor.instances.html_editor.setdata(arguments[0]); }, value);
Comments
Post a Comment