Commit 966a6aea authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4473 Test layout builder browser

parent fe12ea87
......@@ -69,6 +69,7 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->configBlockTest();
$this->previewButtonTest();
$this->layoutBuilderBrowserTest();
}
/**
......@@ -631,4 +632,64 @@ class UwWcmsBasicTest extends BrowserTestBase {
return $return_content_types;
}
/**
* Test Layout Builder Browser.
*
* Test Layout builder browser configuration and its weights.
*/
private function layoutBuilderBrowserTest() {
// Administrator login.
$this->drupalLogin($this->drupalUsers['administrator']);
// Go to Layout Builder Browser configuration page.
$this->drupalGet('admin/config/content/layout-builder-browser');
$this->assertSession()->statusCodeEquals(200);
// Items include Content, External embeds, Listings,
// Searches, Teasers and Webforms, and blocks related.
$items = [
'.region-title-uw_bc_content',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-blockquote"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-call-to-action"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-copy-text"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-expand-collapse"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-facts-and-figures"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-image"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-mailman"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-related-links"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-timeline"]',
'.region-title-uw_bc_external_embeds',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-facebook"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-google-maps"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-instagram"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-powerbi"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-remote-video"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-tableau"]',
'tr[data-drupal-selector="edit-categories-inline-blockuw-cbl-twitter"]',
'.region-title-uw_bc_listings',
'tr[data-drupal-selector="edit-categories-uw-cbl-multi-type-list"]',
'tr[data-drupal-selector="edit-categories-views-blockuw-view-blogs-blogs-listing-block"]',
'tr[data-drupal-selector="edit-categories-views-blockuw-view-events-events-listing-block"]',
'tr[data-drupal-selector="edit-categories-views-blockuw-view-news-items-news-items-listing-block"]',
'.region-title-uw_bc_searches',
'.region-title-uw_bc_teasers',
'tr[data-drupal-selector="edit-categories-uw-cbl-blog-teaser"]',
'tr[data-drupal-selector="edit-categories-uw-cbl-event-teaser"]',
'tr[data-drupal-selector="edit-categories-uw-cbl-news-teaser"]',
'.region-title-uw_bc_webforms',
'tr[data-drupal-selector="edit-categories-webform-block"]',
];
foreach ($items as $item) {
$this->assertSession()->elementExists('css', $item);
}
// All weights except the below three fields are 0.
// The weight of blog post list is -2.
// The weight of event list is -1.
// The weight of news item list is 1.
$this->assertOptionSelected('edit-categories-uw-cbl-multi-type-list-weight', '0');
$this->assertOptionSelected('edit-categories-views-blockuw-view-blogs-blogs-listing-block-weight', '-2');
$this->assertOptionSelected('edit-categories-views-blockuw-view-events-events-listing-block-weight', '-1');
$this->assertOptionSelected('edit-categories-views-blockuw-view-news-items-news-items-listing-block-weight', '1');
}
}
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