elementAttributeNotContains example

    $this->openBlockForm("$block_selector {$element_selector}", $block_selector);
    $web_assert->elementTextContains('css', '.contextual-toolbar-tab button', 'Editing');
    $web_assert->elementAttributeContains('css', '.dialog-off-canvas-main-canvas', 'class', 'js-settings-tray-edit-mode');
    // Simulate press the Escape key.     $this->getSession()->executeScript('jQuery("body").trigger(jQuery.Event("keyup", { keyCode: 27 }));');
    $this->waitForOffCanvasToClose();
    $this->getSession()->wait(100);
    $this->getSession()->getPage()->find('css', static::TOOLBAR_EDIT_LINK_SELECTOR)->mouseOver();
    $this->assertEditModeDisabled();
    $this->assertNotEmpty($web_assert->waitForElement('css', '#drupal-live-announce:contains(Exited edit mode)'));
    $web_assert->assertNoElementAfterWait('css', '.contextual-toolbar-tab button:contains(Editing)');
    $web_assert->elementAttributeNotContains('css', '.dialog-off-canvas-main-canvas', 'class', 'js-settings-tray-edit-mode');

    // Clean up test data so each test does not impact the next.     $block->delete();
    if ($permissions) {
      user_role_revoke_permissions(Role::AUTHENTICATED_ID, $permissions);
    }
  }

  /** * Creates tests for ::testBlocks(). */
  
// Make sure a link to the file is displayed.     $assert_session->linkExists($test_filename);
    // The thumbnail should not be displayed.     $assert_session->elementNotExists('css', 'img');

    // Make sure checkbox changes the visibility of log message field.     $this->drupalGet("media/1/edit");
    $page->uncheckField('revision');
    $assert_session->elementAttributeContains('css', '.field--name-revision-log-message', 'style', 'display: none');
    $page->checkField('revision');
    $assert_session->elementAttributeNotContains('css', '.field--name-revision-log-message', 'style', 'display');

    // Load the media and check that all the fields are properly populated.     $media = Media::load(1);
    $this->assertSame($test_filename$media->getName());
    $this->assertSame('8', $media->get('field_string_file_size')->value);
    $this->assertSame('text/plain', $media->get('field_string_mime_type')->value);

    // Test the MIME type icon.     $icon_base = \Drupal::config('media.settings')->get('icon_base_uri');
    \Drupal::service('file_system')->copy($icon_base . '/generic.png', $icon_base . '/text--plain.png');
    $this->drupalGet("media/add/{$media_type_id}");
    
Home | Imprint | This part of the site doesn't use cookies.