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

Merge branch 'feature/ISTWCMS-4183-l26yan-Create-timeline-block' into '8.x-3.x'

ISTWCMS-4183 Add testing for timeline block

See merge request !24
parents c57b46c5 e5554cd2
......@@ -431,6 +431,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
/**
* Test config block.
* Test help text of Block ID and hiding url alias.
* Test timeline block.
*/
private function configBlockTest() {
$this->drupalLogin($this->drupalUsers['administrator']);
......@@ -445,6 +446,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
'Image gallery',
'Mailman subscription',
'Related links',
'Timeline',
'Facebook',
'Instagram',
'Remote video',
......@@ -475,5 +477,44 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertSession()->pageTextNotContains('Generate automatic URL alias');
$this->assertSession()->pageTextNotContains('URL alias');
}
// Test timeline Step 1: Visit the home page layout.
$this->drupalGet('node/1/layout');
$this->assertSession()->statusCodeEquals(200);
// Test timeline Step 2: Look on the layout edit page to click 'Add block'.
$this->clickLink('Add block');
// Test timeline Step 3: Verify that Blockquote and others are on the layout edit page.
$this->assertSession()->pageTextContains('Choose a block');
// Test timeline Step 4: Look on the page for the 'Timeline' link.
$this->assertSession()->linkExists('Timeline');
// Test timeline Step 5: Click 'Timeline'.
$this->clickLink('Timeline');
// Test timeline Step 6: Show Configure block (pop-up window).
$this->drupalPlaceBlock('layout_builder_add_block');
// Test timeline Step 7: Check all fields and buttons of timeline block.
$this->assertSession()->pageTextContains('Title');
$this->assertFieldById('edit-settings-label');
$this->assertSession()->pageTextContains('Timeline style');
$this->assertFieldById('edit-settings-block-form-field-uw-timeline-style');
$this->assertSession()->pageTextContains('Timeline sort');
$this->assertFieldById('edit-settings-block-form-field-uw-timeline-sort');
$this->assertSession()->pageTextContains('Date');
$this->assertFieldById('edit-settings-block-form-field-uw-timeline-0-subform-field-uw-timeline-date-0-value-date');
$this->assertSession()->pageTextContains('Headline');
$this->assertFieldById('edit-settings-block-form-field-uw-timeline-0-subform-field-uw-timeline-headline-0-value');
$this->assertSession()->pageTextContains('One or both of the "Headline" and "Content" fields must be populated.');
$this->assertSession()->pageTextContains('PHOTO');
$this->assertSession()->buttonExists('Add media');
$this->assertSession()->pageTextContains('One media item remaining.');
$this->assertSession()->pageTextContains('Link');
$this->assertSession()->pageTextContains('Links the entire content to a URL. If entered, do not use links inside the content itself.');
$this->assertSession()->pageTextContains('Content');
$this->assertSession()->buttonExists('Add Timeline');
}
}
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