Issue #3018073 by tim.plunkett, kostyashupenko, mark_fullmer, johndevman, JacobSanford: Stop Using Title Case When Not Appropriate in Layout Builder UI

merge-requests/1119/head
xjm 2019-04-22 12:09:53 -05:00
parent 56961ccfdf
commit 82bba2741a
25 changed files with 119 additions and 119 deletions

View File

@ -87,9 +87,9 @@ class LayoutBuilderContentModerationIntegrationTest extends BrowserTestBase {
$assert_session->checkboxChecked('revision');
$assert_session->fieldDisabled('revision');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// Save the node as a draft. Revision count: 3.
$page->fillField('moderation_state[0][state]', 'draft');
$page->pressButton('Save layout');

View File

@ -13,12 +13,12 @@
let layoutBuilderBlocksFiltered = false;
/**
* Provides the ability to filter the block listing in Add Block dialog.
* Provides the ability to filter the block listing in "Add block" dialog.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attach block filtering behavior to Add Block dialog.
* Attach block filtering behavior to "Add block" dialog.
*/
behaviors.layoutBuilderBlockFilter = {
attach(context) {

View File

@ -174,20 +174,20 @@ class LayoutBuilder extends RenderElement implements ContainerFactoryPluginInter
// layout or an empty layout.
if ($delta === count($section_storage)) {
if ($delta === 0) {
$title = $this->t('Add Section');
$title = $this->t('Add section');
}
else {
$title = $this->t('Add Section <span class="visually-hidden">at end of layout</span>');
$title = $this->t('Add section <span class="visually-hidden">at end of layout</span>');
}
}
// If the delta and the count are different, it is either the beginning of
// the layout or in between two sections.
else {
if ($delta === 0) {
$title = $this->t('Add Section <span class="visually-hidden">at start of layout</span>');
$title = $this->t('Add section <span class="visually-hidden">at start of layout</span>');
}
else {
$title = $this->t('Add Section <span class="visually-hidden">between @first and @second</span>', ['@first' => $delta, '@second' => $delta + 1]);
$title = $this->t('Add section <span class="visually-hidden">between @first and @second</span>', ['@first' => $delta, '@second' => $delta + 1]);
}
}
@ -274,7 +274,7 @@ class LayoutBuilder extends RenderElement implements ContainerFactoryPluginInter
$build[$region]['layout_builder_add_block']['link'] = [
'#type' => 'link',
// Add one to the current delta since it is zero-indexed.
'#title' => $this->t('Add Block <span class="visually-hidden">in section @section, @region region</span>', ['@section' => $delta + 1, '@region' => $region_labels[$region]]),
'#title' => $this->t('Add block <span class="visually-hidden">in section @section, @region region</span>', ['@section' => $delta + 1, '@region' => $region_labels[$region]]),
'#url' => Url::fromRoute('layout_builder.choose_block',
[
'section_storage_type' => $storage_type,
@ -364,7 +364,7 @@ class LayoutBuilder extends RenderElement implements ContainerFactoryPluginInter
'data-dialog-renderer' => 'off_canvas',
],
],
// The section label is added to sections without a "Configure Section"
// The section label is added to sections without a "Configure section"
// link, and is only visible when the move block dialog is open.
'section_label' => [
'#markup' => $this->t('<span class="layout-builder__section-label" aria-hidden="true">Section @section</span>', ['@section' => $delta + 1]),

View File

@ -28,7 +28,7 @@ class AddBlockForm extends ConfigureBlockFormBase {
* {@inheritdoc}
*/
protected function submitLabel() {
return $this->t('Add Block');
return $this->t('Add block');
}
/**

View File

@ -155,7 +155,7 @@ class MoveBlockForm extends FormBase {
$form['components_wrapper']['components'] = [
'#type' => 'table',
'#header' => [
$this->t('Block Label'),
$this->t('Block label'),
$this->t('Weight'),
],
'#tabledrag' => [

View File

@ -55,9 +55,9 @@ class LayoutBuilderQuickEditTest extends BrowserTestBase {
// Place a field block for a user entity field.
$this->drupalGet('node/1/layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Name');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$page->pressButton('Save layout');
$this->drupalGet('node/1');

View File

@ -62,11 +62,11 @@ class LayoutBuilderSectionStorageTest extends BrowserTestBase {
// Add a block to the defaults.
$page->clickLink('Manage layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'Defaults block title');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$page->pressButton('Save layout');
$this->drupalGet('node/1');

View File

@ -109,11 +109,11 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->fieldNotExists('title[0][value]');
$assert_session->elementTextContains('css', '.layout-builder__message.layout-builder__message--overrides', 'You are editing the layout for this Bundle with section field content item. Edit the template for all Bundle with section field content items instead.');
$assert_session->linkExists('Edit the template for all Bundle with section field content items instead.');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is an override');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$page->pressButton('Save layout');
$assert_session->pageTextContains('This is an override');
@ -189,9 +189,9 @@ class LayoutBuilderTest extends BrowserTestBase {
// Create a layout override which will store the current node in the
// tempstore.
$page->clickLink('Layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// Update the node to make a change that is not in the tempstore version.
$node = Node::load(1);
@ -264,13 +264,13 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->pageTextContainsOnce('Placeholder for the "Extra label" field');
// Add a new block.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('Powered by Drupal');
$this->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is the label');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('Powered by Drupal');
$assert_session->pageTextContains('This is the label');
$assert_session->addressEquals("$field_ui_prefix/display/default/layout");
@ -301,7 +301,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$page->pressButton('Remove');
// Add a new section.
$this->clickLink('Add Section');
$this->clickLink('Add section');
$this->assertCorrectLayouts();
$assert_session->linkExists('Two column');
$this->clickLink('Two column');
@ -320,11 +320,11 @@ class LayoutBuilderTest extends BrowserTestBase {
// Alter the defaults.
$this->drupalGet("$field_ui_prefix/display/default/layout");
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('Title');
$this->clickLink('Title');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// The title field is present.
$assert_session->elementExists('css', '.field--name-title');
$page->pressButton('Save layout');
@ -348,11 +348,11 @@ class LayoutBuilderTest extends BrowserTestBase {
// Reverting the override returns it to the defaults.
$this->clickLink('Layout');
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('ID');
$this->clickLink('ID');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// The title field is present.
$assert_session->elementExists('css', '.field--name-nid');
$assert_session->pageTextContains('ID');
@ -525,8 +525,8 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->drupalPostForm('admin/structure/types/manage/bundle_with_section_field/display', ['layout[enabled]' => TRUE], 'Save');
$assert_session->linkExists('Manage layout');
$this->clickLink('Manage layout');
$assert_session->linkExists('Add Section');
$this->clickLink('Add Section');
$assert_session->linkExists('Add section');
$this->clickLink('Add section');
$assert_session->linkExists('Layout plugin (with dependencies)');
$this->clickLink('Layout plugin (with dependencies)');
$assert_session->elementExists('css', '.layout--layout-test-dependencies-plugin');
@ -538,18 +538,18 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->elementExists('css', '.field--name-body');
// Add a menu block.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('My Menu');
$this->clickLink('My Menu');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// Add another block alongside the menu.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('Powered by Drupal');
$this->clickLink('Powered by Drupal');
$page->pressButton('Add Block');
$page->pressButton('Add block');
// Assert that the blocks are visible, and save the layout.
$assert_session->pageTextContains('Powered by Drupal');
@ -595,11 +595,11 @@ class LayoutBuilderTest extends BrowserTestBase {
// Customize the default view mode.
$this->drupalGet("$field_ui_prefix/display/default/layout");
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is the default view mode');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('This is the default view mode');
$page->pressButton('Save layout');
@ -618,11 +618,11 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->drupalPostForm("$field_ui_prefix/display/full", ['layout[enabled]' => TRUE], 'Save');
$this->drupalPostForm("$field_ui_prefix/display/full", ['layout[allow_custom]' => TRUE], 'Save');
$this->drupalGet("$field_ui_prefix/display/full/layout");
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is the full view mode');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('This is the full view mode');
$page->pressButton('Save layout');
@ -657,11 +657,11 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->pageTextNotContains('This is the default view mode');
// Create an override of the full view mode.
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is an override of the full view mode');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('This is an override of the full view mode');
$page->pressButton('Save layout');
@ -695,11 +695,11 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->pageTextNotContains('This is the default view mode');
// Recreate an override of the full view mode.
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is an override of the full view mode');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('This is an override of the full view mode');
$page->pressButton('Save layout');
@ -754,7 +754,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->clickLink('Manage layout');
// Add a new block.
$this->clickLink('Add Block');
$this->clickLink('Add block');
// Verify that blocks not modified are present.
$assert_session->linkExists('Powered by Drupal');
@ -773,13 +773,13 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->clickLink('Manage layout');
// Add a new section.
$this->clickLink('Add Section', 1);
$this->clickLink('Add section', 1);
$assert_session->linkExists('Two column');
$this->clickLink('Two column');
$assert_session->buttonExists('Add section');
$this->getSession()->getPage()->pressButton('Add section');
// Add a new block to second section.
$this->clickLink('Add Block', 1);
$this->clickLink('Add block', 1);
// Verify that Changed block is present on second section.
$assert_session->linkExists('Changed');
@ -855,9 +855,9 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->linkExists('Layout');
$this->clickLink('Layout');
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Test Block View');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('Test Block View');
$assert_session->elementExists('css', '.block-views-blocktest-block-view-block-1');
@ -891,7 +891,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$page->pressButton('Save');
$page->clickLink('Manage layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$assert_session->pageTextContains('Layout Builder Storage: node.bundle_with_section_field.default');
$assert_session->pageTextContains('Layout Builder Section: layout_onecol');
@ -912,7 +912,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->drupalPostForm('admin/structure/types/manage/bundle_with_section_field/display/default', ['layout[enabled]' => TRUE], 'Save');
$page->clickLink('Manage layout');
$page->clickLink('Add Section');
$page->clickLink('Add section');
$page->clickLink('Layout Builder Test Plugin');
// See \Drupal\layout_builder_test\Plugin\Layout\LayoutBuilderTestPlugin::build().
$assert_session->elementExists('css', '.go-birds');
@ -940,10 +940,10 @@ class LayoutBuilderTest extends BrowserTestBase {
$this->drupalGet("$field_ui_prefix/display/default/layout");
// Add a block whose content is controlled by state and is empty by default.
$this->clickLink('Add Block');
$this->clickLink('Add block');
$this->clickLink('Test block caching');
$page->fillField('settings[label]', 'The block label');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$block_content = 'I am content';
$placeholder_content = 'Placeholder for the "The block label" block';
@ -1123,7 +1123,7 @@ class LayoutBuilderTest extends BrowserTestBase {
$assert_session->elementsCount('css', '.layout-builder__add-section', 1);
// Add one section to the override.
$page->clickLink('Add Section');
$page->clickLink('Add section');
$page->clickLink('One column');
$assert_session->elementsCount('css', '.layout', 1);
$assert_session->elementsCount('css', '.layout-builder__add-block', 1);

View File

@ -204,11 +204,11 @@ class LayoutBuilderTranslationTest extends ContentTranslationTestBase {
$assert_session->pageTextContains('The untranslated field value');
// Adjust the layout.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('Powered by Drupal');
$this->clickLink('Powered by Drupal');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->pageTextContains('Powered by Drupal');
$assert_session->buttonExists('Save layout');

View File

@ -53,11 +53,11 @@ class LayoutDisplayTest extends BrowserTestBase {
$assert_session->pageTextNotContains('Powered by Drupal');
$this->drupalGet('node/1/layout');
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->linkExists('Powered by Drupal');
$this->clickLink('Powered by Drupal');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$page->pressButton('Save');
$assert_session->pageTextContains('Powered by Drupal');

View File

@ -74,11 +74,11 @@ abstract class LayoutRestTestBase extends ResourceTestBase {
]);
$this->drupalGet('node/' . $this->node->id() . '/layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$page->clickLink('Powered by Drupal');
$page->fillField('settings[label]', 'This is an override');
$page->checkField('settings[label_display]');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$page->pressButton('Save layout');
$assert_session->pageTextContains('This is an override');

View File

@ -68,8 +68,8 @@ class AjaxBlockTest extends WebDriverTestBase {
$assert_session->elementExists('css', '.field--name-body');
// Add a new block.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->linkExists('TestAjax');
$this->clickLink('TestAjax');
@ -86,7 +86,7 @@ class AjaxBlockTest extends WebDriverTestBase {
}
}
// Then add the block.
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->assertWaitOnAjaxRequest();
$block_elements = $this->cssSelect('.block-layout-builder-test-testajax');
// Should be exactly one of these in there.

View File

@ -53,8 +53,8 @@ class BlockFilterTest extends WebDriverTestBase {
$assert_session->addressEquals("$field_ui_prefix/display/default/layout");
// Open the block listing.
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
// Get all blocks, for assertions later.

View File

@ -56,15 +56,15 @@ class BlockFormMessagesTest extends WebDriverTestBase {
);
$this->clickElementWhenClickable($page->findLink('Manage layout'));
$assert_session->addressEquals($field_ui_prefix . '/display/default/layout');
$this->clickElementWhenClickable($page->findLink('Add Block'));
$this->clickElementWhenClickable($page->findLink('Add block'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas .block-categories'));
$this->clickElementWhenClickable($page->findLink('Powered by Drupal'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas [name="settings[label]"]'));
$page->findField('Title')->setValue('');
$this->clickElementWhenClickable($page->findButton('Add Block'));
$this->clickElementWhenClickable($page->findButton('Add block'));
$this->assertMessagesDisplayed();
$page->findField('Title')->setValue('New title');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$block_css_locator = '#layout-builder .block-system-powered-by-block';
$this->assertNotEmpty($assert_session->waitForElementVisible('css', $block_css_locator));
$this->waitForNoElement('#drupal-off-canvas');

View File

@ -99,19 +99,19 @@ class ContextualLinksTest extends WebDriverTestBase {
* Adds block to the layout via Layout Builder's UI.
*
* @param string $block_name
* The block name as it appears in the Add Block form.
* The block name as it appears in the Add block form.
*/
protected function addBlock($block_name) {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$assert_session->linkExists('Add Block');
$page->clickLink('Add Block');
$assert_session->linkExists('Add block');
$page->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNotEmpty($assert_session->waitForElementVisible('css', "#drupal-off-canvas a:contains('$block_name')"));
$page->clickLink($block_name);
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '[data-drupal-selector=\'edit-actions-submit\']'));
$page->pressButton('Add Block');
$page->pressButton('Add block');
$this->waitForNoElement('#drupal-off-canvas');
$assert_session->assertWaitOnAjaxRequest();
}

View File

@ -192,7 +192,7 @@ class InlineBlockPrivateFilesTest extends InlineBlockTestBase {
protected function addInlineFileBlockToLayout($title, File $file) {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$page->clickLink('Add Block');
$page->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNotEmpty($assert_session->waitForLink('Create custom block'));
$this->clickLink('Create custom block');
@ -200,7 +200,7 @@ class InlineBlockPrivateFilesTest extends InlineBlockTestBase {
$assert_session->fieldValueEquals('Title', '');
$page->findField('Title')->setValue($title);
$this->attachFileToBlockForm($file);
$page->pressButton('Add Block');
$page->pressButton('Add block');
$this->assertDialogClosedAndTextVisible($file->label(), static::INLINE_BLOCK_LOCATOR);
}

View File

@ -465,7 +465,7 @@ class InlineBlockTest extends InlineBlockTestBase {
$layout_default_path = 'admin/structure/types/manage/bundle_with_section_field/display/default/layout';
$this->drupalGet($layout_default_path);
// Add a basic block with the body field set.
$page->clickLink('Add Block');
$page->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
// Confirm that with no block content types the link does not appear.
$assert_session->linkNotExists('Create custom block');
@ -474,7 +474,7 @@ class InlineBlockTest extends InlineBlockTestBase {
$this->drupalGet($layout_default_path);
// Add a basic block with the body field set.
$page->clickLink('Add Block');
$page->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
// Confirm with only 1 type the "Create custom block" link goes directly t
// block add form.
@ -487,7 +487,7 @@ class InlineBlockTest extends InlineBlockTestBase {
$this->drupalGet($layout_default_path);
// Add a basic block with the body field set.
$page->clickLink('Add Block');
$page->clickLink('Add block');
// Confirm that, when more than 1 type exists, "Create custom block" shows a
// list of block types.
$assert_session->assertWaitOnAjaxRequest();
@ -519,7 +519,7 @@ class InlineBlockTest extends InlineBlockTestBase {
$this->drupalLogin($this->drupalCreateUser($permissions));
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas .block-categories'));
if ($expected) {
$assert_session->linkExists('Create custom block');

View File

@ -133,7 +133,7 @@ abstract class InlineBlockTestBase extends WebDriverTestBase {
protected function addInlineBlockToLayout($title, $body) {
$assert_session = $this->assertSession();
$page = $this->getSession()->getPage();
$page->clickLink('Add Block');
$page->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNotEmpty($assert_session->waitForLink('Create custom block'));
$this->clickLink('Create custom block');
@ -143,7 +143,7 @@ abstract class InlineBlockTestBase extends WebDriverTestBase {
$assert_session->fieldValueEquals('Title', '');
$page->findField('Title')->setValue($title);
$textarea->setValue($body);
$page->pressButton('Add Block');
$page->pressButton('Add block');
$this->assertDialogClosedAndTextVisible($body, static::INLINE_BLOCK_LOCATOR);
}

View File

@ -64,7 +64,7 @@ class ItemLayoutFieldBlockTest extends WebDriverTestBase {
$this->drupalGet('node/1/layout');
// Add a new block.
$this->clickLink('Add Block');
$this->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
// Validate that only field blocks for layouted bundle are present.

View File

@ -142,8 +142,8 @@ class LayoutBuilderDisableInteractionsTest extends WebDriverTestBase {
$page = $this->getSession()->getPage();
// Add a new block.
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#layout-builder a:contains(\'Add Block\')'));
$this->clickLink('Add Block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#layout-builder a:contains(\'Add block\')'));
$this->clickLink('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas'));
$assert_session->assertWaitOnAjaxRequest();
@ -153,7 +153,7 @@ class LayoutBuilderDisableInteractionsTest extends WebDriverTestBase {
// Wait for off-canvas dialog to reopen with block form.
$this->assertNotEmpty($assert_session->waitForElementVisible('css', ".layout-builder-add-block"));
$assert_session->assertWaitOnAjaxRequest();
$page->pressButton('Add Block');
$page->pressButton('Add block');
// Wait for block form to be rendered in the Layout Builder.
$this->assertNotEmpty($assert_session->waitForElement('css', $rendered_locator));

View File

@ -96,12 +96,12 @@ class LayoutBuilderQuickEditTest extends QuickEditJavascriptTestBase {
$assert_session = $this->assertSession();
$this->loginLayoutAdmin();
$this->drupalGet('admin/structure/types/manage/article/display/default/layout');
$page->clickLink('Add Block');
$page->clickLink('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas'));
$assert_session->assertWaitOnAjaxRequest();
$page->clickLink('Body');
$assert_session->assertWaitOnAjaxRequest();
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->assertWaitOnAjaxRequest();
$page->pressButton('Save layout');
$this->assertNotEmpty($assert_session->waitForElement('css', '.messages--status'));

View File

@ -114,7 +114,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->clickLink('Layout');
$this->markCurrentPage();
$assert_session->pageTextContains('The node body');
$assert_session->linkExists('Add Section');
$assert_session->linkExists('Add section');
// Add a new block.
$this->openAddBlockForm('Powered by Drupal');
@ -123,7 +123,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$page->checkField('settings[label_display]');
// Save the new block, and ensure it is displayed on the page.
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNoElementAfterWait('#drupal-off-canvas');
$assert_session->addressEquals($layout_url);
@ -149,8 +149,8 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->drupalGet($layout_url);
$this->markCurrentPage();
$assert_session->linkExists('Add Section');
$this->clickLink('Add Section');
$assert_session->linkExists('Add section');
$this->clickLink('Add section');
$this->assertNotEmpty($assert_session->waitForElementVisible('named', ['link', 'Two column']));
$this->clickLink('Two column');
@ -207,7 +207,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->assertNoElementAfterWait('#drupal-off-canvas');
$assert_session->pageTextNotContains('Powered by Drupal');
$assert_session->linkExists('Add Block');
$assert_session->linkExists('Add block');
$assert_session->addressEquals($layout_url);
$this->assertPageNotReloaded();
@ -219,7 +219,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->markCurrentPage();
$this->openAddBlockForm('My custom block');
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->pageTextContains('This is the block content');
@ -239,7 +239,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$assert_session->assertWaitOnAjaxRequest();
$assert_session->pageTextNotContains('This is the block content');
$assert_session->linkNotExists('Add Block');
$assert_session->linkNotExists('Add block');
$this->assertPageNotReloaded();
$page->pressButton('Save layout');
@ -274,8 +274,8 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->drupalGet($layout_url);
$this->markCurrentPage();
$assert_session->linkExists('Add Section');
$this->clickLink('Add Section');
$assert_session->linkExists('Add section');
$this->clickLink('Add section');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->elementExists('css', '#drupal-off-canvas');
@ -284,8 +284,8 @@ class LayoutBuilderTest extends WebDriverTestBase {
$assert_session->assertWaitOnAjaxRequest();
// Add another section.
$assert_session->linkExists('Add Section');
$this->clickLink('Add Section');
$assert_session->linkExists('Add section');
$this->clickLink('Add section');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->elementExists('css', '#drupal-off-canvas');
@ -298,7 +298,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->assertNoElementAfterWait('#drupal-off-canvas');
$assert_session->pageTextContains('Default');
$assert_session->linkExists('Add Block');
$assert_session->linkExists('Add block');
// Configure the existing section.
$assert_session->linkExists('Configure section 1');
@ -353,7 +353,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$this->assertNoElementAfterWait('#drupal-off-canvas');
$page->fillField('settings[label]', 'The block label');
$page->fillField('settings[label_display]', TRUE);
$page->pressButton('Add Block');
$page->pressButton('Add block');
$assert_session->addressEquals($layout_url);
$assert_session->pageTextContains('Powered by Drupal');
@ -369,7 +369,7 @@ class LayoutBuilderTest extends WebDriverTestBase {
$assert_session->addressEquals($layout_url);
$assert_session->pageTextNotContains('Powered by Drupal');
$assert_session->pageTextNotContains('The block label');
$assert_session->linkNotExists('Add Block');
$assert_session->linkNotExists('Add block');
}
/**
@ -464,8 +464,8 @@ class LayoutBuilderTest extends WebDriverTestBase {
*/
private function openAddBlockForm($block_title) {
$assert_session = $this->assertSession();
$assert_session->linkExists('Add Block');
$this->clickLink('Add Block');
$assert_session->linkExists('Add block');
$this->clickLink('Add block');
$assert_session->assertWaitOnAjaxRequest();
$this->assertNotEmpty($assert_session->waitForElementVisible('named', ['link', $block_title]));
$this->clickLink($block_title);

View File

@ -71,13 +71,13 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
$assert_session->assertWaitOnAjaxRequest();
// Assert that there are no sections on the page.
$assert_session->pageTextNotContains('Remove section');
$assert_session->pageTextNotContains('Add Block');
$assert_session->pageTextNotContains('Add block');
// Reload the page.
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
// Assert that there are no sections on the page.
$assert_session->pageTextNotContains('Remove section');
$assert_session->pageTextNotContains('Add Block');
$assert_session->pageTextNotContains('Add block');
}
/**
@ -110,7 +110,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
$page = $this->getSession()->getPage();
$this->drupalGet($path);
$page->clickLink('Add Section');
$page->clickLink('Add section');
$assert_session->assertWaitOnAjaxRequest();
$assert_session->pageTextNotContains('You have unsaved changes.');
$page->clickLink('One column');
@ -140,7 +140,7 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
$this->drupalGet(static::FIELD_UI_PREFIX . '/display/default/layout');
$assert_session->elementsCount('css', '.layout-builder__add-section', 2);
$assert_session->elementNotExists('css', '.is-layout-builder-highlighted');
$page->clickLink('Add Section');
$page->clickLink('Add section');
$this->assertNotEmpty($assert_session->waitForElement('css', '#drupal-off-canvas .item-list'));
$assert_session->assertWaitOnAjaxRequest();
@ -162,14 +162,14 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
$assert_session->elementsCount('css', '.layout-builder__add-block', 3);
// Add a custom block.
$page->clickLink('Add Block');
$page->clickLink('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'a:contains("Create custom block")'));
$assert_session->assertWaitOnAjaxRequest();
// Highlight is present with ChooseBlockController::build().
$this->assertHighlightedElement('[data-layout-builder-highlight-id="block-0-first"]');
$page->clickLink('Create custom block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas input[value="Add Block"]'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas input[value="Add block"]'));
$assert_session->assertWaitOnAjaxRequest();
// Highlight is present with ChooseBlockController::inlineBlockList().
@ -178,12 +178,12 @@ class LayoutBuilderUiTest extends WebDriverTestBase {
$this->assertHighlightNotExists();
// The highlight should persist with all block config dialogs.
$page->clickLink('Add Block');
$page->clickLink('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'a:contains("Recent content")'));
$assert_session->assertWaitOnAjaxRequest();
$this->assertHighlightedElement('[data-layout-builder-highlight-id="block-0-first"]');
$page->clickLink('Recent content');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas input[value="Add Block"]'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas input[value="Add block"]'));
// The highlight is present with ConfigureBlockFormBase::doBuildForm().
$this->assertHighlightedElement('[data-layout-builder-highlight-id="block-0-first"]');

View File

@ -64,7 +64,7 @@ class MoveBlockFormTest extends WebDriverTestBase {
$this->assertRegionBlocksOrder(0, 'content', $expected_block_order);
// Add a top section using the Two column layout.
$page->clickLink('Add Section');
$page->clickLink('Add section');
$assert_session->waitForElementVisible('css', '#drupal-off-canvas');
$assert_session->assertWaitOnAjaxRequest();
$page->clickLink('Two column');
@ -80,9 +80,9 @@ class MoveBlockFormTest extends WebDriverTestBase {
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas a:contains("Powered by Drupal")'));
$assert_session->assertWaitOnAjaxRequest();
$page->clickLink('Powered by Drupal');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'input[value="Add Block"]'));
$this->assertNotEmpty($assert_session->waitForElementVisible('css', 'input[value="Add block"]'));
$assert_session->assertWaitOnAjaxRequest();
$page->pressButton('Add Block');
$page->pressButton('Add block');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', $first_region_block_locator));
// Ensure the request has completed before the test starts.

View File

@ -82,8 +82,8 @@ class TestMultiWidthLayoutsTest extends WebDriverTestBase {
];
foreach ($width_options as $width_option) {
$width = array_shift($width_option['widths']);
$assert_session->linkExists('Add Section');
$page->clickLink('Add Section');
$assert_session->linkExists('Add section');
$page->clickLink('Add section');
$this->assertNotEmpty($assert_session->waitForElementVisible('css', "#drupal-off-canvas a:contains(\"{$width_option['label']}\")"));
$page->clickLink($width_option['label']);
$this->assertNotEmpty($assert_session->waitForElementVisible('css', '#drupal-off-canvas input[type="submit"][value="Add section"]'));