How i add text in a tag in e2e testing Angular Protractor

后端 未结 1 1681
不思量自难忘°
不思量自难忘° 2021-01-17 05:07

how i add content in

tag for e2e testing in protractor


 
  

        
相关标签:
1条回答
  • 2021-01-17 05:44

    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');
    
    0 讨论(0)
提交回复
热议问题