Commit cbd3a0d9 authored by Igor Biki's avatar Igor Biki
Browse files

ISTWCMS-4232: Adding cta block test.

parent 4cd149df
......@@ -66,6 +66,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->catalogTest();
$this->schemaTest();
$this->configBlockTest();
$this->previewButtonTest();
......@@ -74,9 +75,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->globalFooterTest();
$this->menusTest();
$this->dashboardTest();
$this->ctaBlockTest();
}
/**
......@@ -831,4 +830,41 @@ class UwWcmsBasicTest extends BrowserTestBase {
}
}
/**
* Tests for Custom block CTA.
*/
function ctaBlockTest() {
$this->drupalLogin($this->drupalUsers['administrator']);
// Test step 1: Visit the home page layout.
$this->drupalGet('node/1/layout');
$this->assertSession()->statusCodeEquals(200);
// Test step 2: Look on the layout edit page to click 'Add block'.
$this->clickLink('Add block');
// Test step 3: Verify that cta block and others are on the
// layout edit page.
$this->assertSession()->pageTextContains('Choose a block');
// Test step 4: Look on the page for the 'Call to action' link.
$this->assertSession()->linkExists('Call to action');
// Test step 6: Click 'Call to action'.
$this->clickLink('Call to action');
// Use random string as cta label, saving for later compare.
$cta_label = $this->randomString();
$this->submitForm([
'edit-settings-label' => 'Block description title',
'edit-settings-block-form-field-uw-cta-details-0-subform-field-uw-cta-link-0-uri' => '/home',
'edit-settings-block-form-field-uw-cta-details-0-subform-field-uw-cta-link-0-title' => $this->randomString(),
'edit-settings-block-form-field-uw-cta-details-0-subform-field-uw-cta-text-details-0-text-value' => $cta_label,
'edit-settings-block-form-field-uw-cta-details-0-subform-field-uw-cta-theme' => 'org-default',
], 'Add block');
$this->assertSession()->statusCodeEquals(200);
$this->assertSession()->pageTextContains($cta_label);
}
}
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