Skip to content
Snippets Groups Projects
Commit fbd62908 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-7189 Add switchToIFrame to make WcmsTestsBlocksWebformsCest work

parent db2eeeab
No related branches found
No related tags found
1 merge request!83ISTWCMS-7160 Fix service content type in testAutomaticListBlocksSettings in...
<?php <?php
use Codeception\Util\Locator;
use Drupal\webform\Entity\Webform; use Drupal\webform\Entity\Webform;
/** /**
...@@ -65,6 +64,9 @@ class WcmsTestsBlocksWebformsCest { ...@@ -65,6 +64,9 @@ class WcmsTestsBlocksWebformsCest {
$i->click('Webform'); $i->click('Webform');
$i->waitForText('Configure block'); $i->waitForText('Configure block');
// Switch the block form iframe.
$i->switchToIFrame('iframe[class="lbim-dialog-iframe"]');
// The settings for the webform block. // The settings for the webform block.
$title = $i->uwRandomString(); $title = $i->uwRandomString();
$webform_name = 'Test form (test_form)'; $webform_name = 'Test form (test_form)';
...@@ -75,8 +77,11 @@ class WcmsTestsBlocksWebformsCest { ...@@ -75,8 +77,11 @@ class WcmsTestsBlocksWebformsCest {
// Click on add block and ensure it is on the screen. // Click on add block and ensure it is on the screen.
$i->click('Add block'); $i->click('Add block');
$i->waitForElement(Locator::contains('div[class="uw-admin-label"]', 'Webform'));
$i->seeElement(Locator::contains('div[class="uw-admin-label"]', 'Webform')); // Switch to iFrame.
$i->switchtoIFrame();
$i->waitForText($title);
$i->see($title);
// Need to save the layout to continue the tests. // Need to save the layout to continue the tests.
$i->waitForElementClickable('#edit-actions #edit-submit'); $i->waitForElementClickable('#edit-actions #edit-submit');
...@@ -84,7 +89,7 @@ class WcmsTestsBlocksWebformsCest { ...@@ -84,7 +89,7 @@ class WcmsTestsBlocksWebformsCest {
// Ensure elements are on the page. // Ensure elements are on the page.
$i->see($title); $i->see($title);
$i->click('input[class*="webform-button--submit"][value="Submit"]'); $i->click('input[id="edit-submit"]');
// Wait for a click the back to form. // Wait for a click the back to form.
$i->waitForText('Back to form'); $i->waitForText('Back to form');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment