From 82bba2741ae6ed9a2be40ab29e20ba2f125b145a Mon Sep 17 00:00:00 2001 From: xjm Date: Mon, 22 Apr 2019 12:09:53 -0500 Subject: [PATCH] Issue #3018073 by tim.plunkett, kostyashupenko, mark_fullmer, johndevman, JacobSanford: Stop Using Title Case When Not Appropriate in Layout Builder UI --- ...uilderContentModerationIntegrationTest.php | 4 +- .../layout_builder/js/layout-builder.es6.js | 4 +- .../src/Element/LayoutBuilder.php | 12 +-- .../layout_builder/src/Form/AddBlockForm.php | 2 +- .../layout_builder/src/Form/MoveBlockForm.php | 2 +- .../Functional/LayoutBuilderQuickEditTest.php | 4 +- .../LayoutBuilderSectionStorageTest.php | 4 +- .../src/Functional/LayoutBuilderTest.php | 80 +++++++++---------- .../LayoutBuilderTranslationTest.php | 6 +- .../src/Functional/LayoutDisplayTest.php | 6 +- .../Functional/Rest/LayoutRestTestBase.php | 4 +- .../FunctionalJavascript/AjaxBlockTest.php | 6 +- .../FunctionalJavascript/BlockFilterTest.php | 4 +- .../BlockFormMessagesTest.php | 6 +- .../ContextualLinksTest.php | 8 +- .../InlineBlockPrivateFilesTest.php | 4 +- .../FunctionalJavascript/InlineBlockTest.php | 8 +- .../InlineBlockTestBase.php | 4 +- .../ItemLayoutFieldBlockTest.php | 2 +- .../LayoutBuilderDisableInteractionsTest.php | 6 +- .../LayoutBuilderQuickEditTest.php | 4 +- .../LayoutBuilderTest.php | 32 ++++---- .../LayoutBuilderUiTest.php | 16 ++-- .../MoveBlockFormTest.php | 6 +- .../TestMultiWidthLayoutsTest.php | 4 +- 25 files changed, 119 insertions(+), 119 deletions(-) diff --git a/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php b/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php index e1a30e3af10..8e58a7dfa61 100644 --- a/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php +++ b/core/modules/content_moderation/tests/src/Functional/LayoutBuilderContentModerationIntegrationTest.php @@ -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'); diff --git a/core/modules/layout_builder/js/layout-builder.es6.js b/core/modules/layout_builder/js/layout-builder.es6.js index 7fc5ed7a2ed..f414cb69f3e 100644 --- a/core/modules/layout_builder/js/layout-builder.es6.js +++ b/core/modules/layout_builder/js/layout-builder.es6.js @@ -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) { diff --git a/core/modules/layout_builder/src/Element/LayoutBuilder.php b/core/modules/layout_builder/src/Element/LayoutBuilder.php index db80176b16f..a763659fa3f 100644 --- a/core/modules/layout_builder/src/Element/LayoutBuilder.php +++ b/core/modules/layout_builder/src/Element/LayoutBuilder.php @@ -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 at end of layout'); + $title = $this->t('Add section at end of layout'); } } // 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 at start of layout'); + $title = $this->t('Add section at start of layout'); } else { - $title = $this->t('Add Section between @first and @second', ['@first' => $delta, '@second' => $delta + 1]); + $title = $this->t('Add section between @first and @second', ['@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 in section @section, @region region', ['@section' => $delta + 1, '@region' => $region_labels[$region]]), + '#title' => $this->t('Add block in section @section, @region region', ['@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('', ['@section' => $delta + 1]), diff --git a/core/modules/layout_builder/src/Form/AddBlockForm.php b/core/modules/layout_builder/src/Form/AddBlockForm.php index 6f73133de71..63c79c2c46c 100644 --- a/core/modules/layout_builder/src/Form/AddBlockForm.php +++ b/core/modules/layout_builder/src/Form/AddBlockForm.php @@ -28,7 +28,7 @@ class AddBlockForm extends ConfigureBlockFormBase { * {@inheritdoc} */ protected function submitLabel() { - return $this->t('Add Block'); + return $this->t('Add block'); } /** diff --git a/core/modules/layout_builder/src/Form/MoveBlockForm.php b/core/modules/layout_builder/src/Form/MoveBlockForm.php index 49e97afa72a..8bc79389633 100644 --- a/core/modules/layout_builder/src/Form/MoveBlockForm.php +++ b/core/modules/layout_builder/src/Form/MoveBlockForm.php @@ -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' => [ diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php index 755c9e5ea99..e58f2c613fc 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderQuickEditTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php index c1dd0238051..91732289391 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderSectionStorageTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php index 05866611a41..60d9b8df4d6 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTest.php @@ -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); diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php index 819047cf22e..a86388277e3 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutBuilderTranslationTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php b/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php index e6e4a2b0d8f..d1c4ba0ff6a 100644 --- a/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php +++ b/core/modules/layout_builder/tests/src/Functional/LayoutDisplayTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php b/core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php index 36e8ee74d47..752289162ef 100644 --- a/core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php +++ b/core/modules/layout_builder/tests/src/Functional/Rest/LayoutRestTestBase.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php index 1667669d499..9cedac930e5 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php @@ -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. diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php index f7945d7129f..86912bf58e9 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFilterTest.php @@ -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. diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php index 226e670ce1a..f8e01d2af98 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/BlockFormMessagesTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php index db398a096f4..b6fe178b796 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ContextualLinksTest.php @@ -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(); } diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php index c15bb4ddbe9..f18ff580c4c 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockPrivateFilesTest.php @@ -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); } diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php index f1c2b67fb27..a256b253990 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php @@ -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'); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php index ca8cdc8381e..fa8650a5de0 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTestBase.php @@ -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); } diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php index 92b48a7762a..5acc2034b3a 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php @@ -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. diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php index 8ee4658218f..eb06364b3fe 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderDisableInteractionsTest.php @@ -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)); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php index 1de9bd5e658..4609aa4d661 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderQuickEditTest.php @@ -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')); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php index a9622006aa7..e2341ca2af9 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderTest.php @@ -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); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php index eb6848abcc6..05402965407 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/LayoutBuilderUiTest.php @@ -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"]'); diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php index d2a25a7afaf..e68ff5ad5bb 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/MoveBlockFormTest.php @@ -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. diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php index 4b4ee00533a..86b3e3de866 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/TestMultiWidthLayoutsTest.php @@ -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"]'));