From aab1db682aba89a4507b6f328e82ebc2d90b587a Mon Sep 17 00:00:00 2001
From: Lily Yan <l26yan@uwaterloo.ca>
Date: Thu, 19 Dec 2024 14:44:06 -0500
Subject: [PATCH] ISTWCMS-7189 Add switchToIFrame to make testContentTypeEdits
 work in ContentType

---
 _support/Step/Acceptance/ContentType.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/_support/Step/Acceptance/ContentType.php b/_support/Step/Acceptance/ContentType.php
index c496db0..12a624c 100644
--- a/_support/Step/Acceptance/ContentType.php
+++ b/_support/Step/Acceptance/ContentType.php
@@ -252,6 +252,9 @@ class ContentType extends \AcceptanceTester {
       $i->click('Copy text');
       $i->waitForText('Configure block');
 
+      // Switch the block form iframe.
+      $i->switchToIFrame('iframe[class="lbim-dialog-iframe"]');
+
       // FIll in fields.
       $i->fillField('input[name="settings[label]"]', $i->uwRandomString());
       $i->fillCkEditor($i->uwRandomString(), 'textarea[name="settings[block_form][field_uw_copy_text][0][value]"]');
@@ -259,8 +262,10 @@ class ContentType extends \AcceptanceTester {
       // Click add block and ensure it appears on page.
       $i->waitForText('Add block');
       $i->click('Add block');
-      $i->waitForElement(Locator::contains('div[class="uw-admin-label"]', 'Copy text'));
-      $i->seeElement(Locator::contains('div[class="uw-admin-label"]', 'Copy text'));
+      $i->click('Add block');
+      $i->switchToIFrame();
+      $i->waitForElement('div[class="uw-copy-text"]');
+      $i->seeElement('div[class="uw-copy-text"]');
 
       // Save the layout and ensure that new block appears
       // on the page with correct section classes.
-- 
GitLab