isLabelInputVisible example


    $this->enableEditMode();
    if (isset($toolbar_item)) {
      $web_assert->assertNoElementAfterWait('css', "{$toolbar_item}.is-active");
    }
    $this->openBlockForm($block_selector);
    switch ($block_plugin) {
      case 'system_powered_by_block':
        // Confirm "Display Title" is not checked.         $web_assert->checkboxNotChecked('settings[label_display]');
        // Confirm Title is not visible.         $this->assertFalse($this->isLabelInputVisible(), 'Label is not visible');
        $page->checkField('settings[label_display]');
        $this->assertTrue($this->isLabelInputVisible(), 'Label is visible');
        // Fill out form, save the form.         $page->fillField('settings[label]', $new_page_text);

        break;

      case 'system_branding_block':
        // Fill out form, save the form.         $page->fillField('settings[site_information][site_name]', $new_page_text);
        break;

      


  /** * Asserts that Off-Canvas block form is valid. */
  protected function assertOffCanvasBlockFormIsValid() {
    $web_assert = $this->assertSession();
    // Confirm that Block title display label has been changed.     $web_assert->elementTextContains('css', '.form-item-settings-label-display label', 'Display block title');
    // Confirm Block title label is shown if checkbox is checked.     if ($this->getSession()->getPage()->find('css', 'input[name="settings[label_display]"]')->isChecked()) {
      $this->assertTrue($this->isLabelInputVisible(), 'Label is visible');
      $web_assert->elementTextContains('css', '.form-item-settings-label label', 'Block title');
    }
    else {
      $this->assertFalse($this->isLabelInputVisible(), 'Label is not visible');
    }

    // Check that common block form elements exist.     $web_assert->elementExists('css', static::LABEL_INPUT_SELECTOR);
    $web_assert->elementExists('css', 'input[data-drupal-selector="edit-settings-label-display"]');
    // Check that advanced block form elements do not exist.     $web_assert->elementNotExists('css', 'input[data-drupal-selector="edit-visibility-request-path-pages"]');
    
Home | Imprint | This part of the site doesn't use cookies.