Test WordPress TinyMCE with Codeception

I am trying to add content in a WordPress post type with an acceptance test in Codeception.

I tried several things but I can not make to work.

Read More

For example. I would like to add content in a Post or Page or Product. The main content is the iframe with TinyMCE in WordPress.

The best solution I found until now is this but it is not working on WordPress :

$I->switchToIFrame('#content_ifr');
$I->executeJS('document.getElementById("tinymce").innerHTML = "<p>Test content</p>";');

Have you got any idea how to implement this?

Related posts

1 comment

  1. If anyone need to add content in the tinymce editor in WordPress with Codeception the solution is this :

     $I->click('#content-html');
    
     $I->fillField('#content', 'Test Content');
    

    With the 1st command we change the tinymce tab to html and with the 2nd one we can add the content we like inside.

    Hope this helps!

Comments are closed.