Commit 1caf6dea authored by Liam Morland's avatar Liam Morland
Browse files

ISTWCMS-4203: Test google_maps block

parent a3ad178e
......@@ -677,6 +677,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
'Facebook',
'Facts and figures',
'Full width image',
'Google Maps',
'Image gallery',
'Instagram',
'Mailman subscription',
......@@ -712,6 +713,21 @@ class UwWcmsBasicTest extends BrowserTestBase {
// Test Tableau block.
switch ($block) {
case 'Google Maps':
// Create Google Maps block.
$edit = [
'edit-settings-label' => $this->randomString(),
'edit-settings-block-form-field-gmaps-embedded-url-0-uri' => 'https://www.google.com/maps/embed?pb=' . $this->randomMachineName(),
'edit-settings-block-form-field-gmaps-height-0-value' => rand(150, 1000),
];
$this->submitForm($edit, 'Add block');
// Test that the Google Maps block markup appears on the page.
$this->assertSession()->pageTextContains($edit['edit-settings-label']);
$this->assertFieldByXPath('//div[@class="uw-google-maps"]/div[text()="Enable JavaScript to view map."]');
$this->assertFieldByXPath('//div[@class="uw-google-maps"]/iframe[@height="' . $edit['edit-settings-block-form-field-gmaps-height-0-value'] . '" and @src="' . $edit['edit-settings-block-form-field-gmaps-embedded-url-0-uri'] . '"]');
break;
case 'Tableau visualization':
// Create Tableau block.
$edit = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment