From 9dcb12c6755079f3947b63c7e90ea83daf169f39 Mon Sep 17 00:00:00 2001
From: Lily Yan <l26yan@uwaterloo.ca>
Date: Thu, 9 Jan 2025 11:22:41 -0500
Subject: [PATCH] ISTWCMS-7189 Trigger CKEditor update to make
 WcmsTestsImgInlineCest work

---
 acceptance/WcmsTestsImgInlineCest.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/acceptance/WcmsTestsImgInlineCest.php b/acceptance/WcmsTestsImgInlineCest.php
index 9e0b3cc..588c287 100644
--- a/acceptance/WcmsTestsImgInlineCest.php
+++ b/acceptance/WcmsTestsImgInlineCest.php
@@ -72,10 +72,14 @@ class WcmsTestsImgInlineCest {
         'textarea[name="settings[block_form][field_uw_copy_text][0][value]"]'
       );
 
+      // Trigger CKEditor update.
+      $i->executeJS('for (instance in CKEDITOR.instances) { CKEDITOR.instances[instance].updateElement(); }');
+
       // Click the submit button.
       $i->waitForElementClickable('input[id*="edit-actions-submit"]');
       $i->click('input[id*="edit-actions-submit"]');
       $i->switchToIFrame();
+
       // Ensure that the block is on the page.
       $i->waitForJS("return document.readyState === 'complete';", 30);
       $i->waitForElement(".uw-copy-text div " . $block . " img", 30);
-- 
GitLab