From 369b34e7b705da38c65e9f6b92e70bde039a472b Mon Sep 17 00:00:00 2001 From: Lily Yan <l26yan@uwaterloo.ca> Date: Thu, 19 Dec 2024 15:16:47 -0500 Subject: [PATCH] ISTWCMS-7189 Add switchToIFrame to make WcmsTestsImgInlineCest work --- acceptance/WcmsTestsImgInlineCest.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/acceptance/WcmsTestsImgInlineCest.php b/acceptance/WcmsTestsImgInlineCest.php index ba92cc8..9e0b3cc 100644 --- a/acceptance/WcmsTestsImgInlineCest.php +++ b/acceptance/WcmsTestsImgInlineCest.php @@ -49,6 +49,10 @@ class WcmsTestsImgInlineCest { $i->waitForText('Choose a block'); $i->click('Copy text'); + $i->waitForText('Configure block'); + + // Switch the block form iframe. + $i->switchToIFrame('iframe[class="lbim-dialog-iframe"]'); $i->waitForText('Block description'); // Fill the title. @@ -71,7 +75,7 @@ class WcmsTestsImgInlineCest { // 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); @@ -79,12 +83,14 @@ class WcmsTestsImgInlineCest { // Check that image's parent is a block. $i->seeElement(".uw-copy-text div " . $block . " img", ['alt' => 'Inserted image in ' . $block . ' block']); + $i->waitForJS("return document.readyState === 'complete';"); // Remove added block to avoid ambiguity in finding image. $i->amOnPage($path . '/layout/discard-changes'); $i->click('#edit-submit'); - $i->waitForJS("return document.readyState === 'complete';", 30); - $i->waitForText("The changes to the layout have been discarded.", 60); + $i->switchToIFrame(); + $i->waitForJS("return document.readyState === 'complete';"); + $i->waitForText("The changes to the layout have been discarded."); } } -- GitLab