diff --git a/tests/Behat/Context/Setup/BlockContext.php b/tests/Behat/Context/Setup/BlockContext.php index 0dec287d..c0532f8e 100755 --- a/tests/Behat/Context/Setup/BlockContext.php +++ b/tests/Behat/Context/Setup/BlockContext.php @@ -94,6 +94,7 @@ private function createBlockWithContentElement(string $code, string $contentElem /** @var ContentConfigurationInterface $contentConfiguration */ $contentConfiguration = new ContentConfiguration(); $contentConfiguration->setType(mb_strtolower($contentElement)); + $contentConfiguration->setLocale('en_US'); $contentConfiguration->setConfiguration(ContentElementHelper::getExampleConfigurationByContentElement($contentElement)); $contentConfiguration->setBlock($block); diff --git a/tests/Behat/Context/Setup/PageContext.php b/tests/Behat/Context/Setup/PageContext.php index 43352ebc..d4a4aca4 100755 --- a/tests/Behat/Context/Setup/PageContext.php +++ b/tests/Behat/Context/Setup/PageContext.php @@ -205,6 +205,7 @@ private function createPageWithContentElement(string $contentElement): PageInter /** @var ContentConfigurationInterface $contentConfiguration */ $contentConfiguration = new ContentConfiguration(); $contentConfiguration->setType(mb_strtolower($contentElement)); + $contentConfiguration->setLocale('en_US'); $contentConfiguration->setConfiguration(ContentElementHelper::getExampleConfigurationByContentElement($contentElement)); $contentConfiguration->setPage($page); diff --git a/tests/Behat/Page/Admin/Page/CreatePage.php b/tests/Behat/Page/Admin/Page/CreatePage.php index 7476451a..e3646280 100755 --- a/tests/Behat/Page/Admin/Page/CreatePage.php +++ b/tests/Behat/Page/Admin/Page/CreatePage.php @@ -111,8 +111,21 @@ public function addTextareaContentElementWithContent(string $content): void { Assert::isInstanceOf($this->getDriver(), ChromeDriver::class); - $textarea = $this->getElement('content_elements_textarea'); - $textarea->setValue($content); + $iframe = $this->getDocument()->find('css', '.cke_wysiwyg_frame'); + if (null === $iframe) { + throw new \Exception('CKEditor iframe not found'); + } + + $this->getDriver()->switchToIFrame($iframe->getAttribute('name')); + + $body = $this->getDocument()->find('css', 'body'); + if (null === $body) { + throw new \Exception('CKEditor body not found'); + } + + $body->setValue($content); + + $this->getDriver()->switchToIFrame(null); } public function addSingleMediaContentElementWithName(string $name): void