how i add content in
tag for e2e testing in protractor
First of all, it is the body that's editable in this case - send keys to it:
var body = element(by.css('body.cke_editable'));
body.sendKeys('This is a paragraph tag');
A bigger problem though is that, since this is a CKeditor - it's usually embedded in an iframe
. This is actually important for us - we need to let the webdriver know that we want to switch into the context of the iframe
:
browser.switchTo().frame(element(by.css("iframe.cke_wysiwyg_frame")));
var body = element(by.css('body.cke_editable'));
body.sendKeys('This is a paragraph tag');