elementNotContains example

// The heading plugin config form should be present.     $assert_session->elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-heading"]');

    // Remove the heading plugin from the toolbar.     $this->triggerKeyUp('.ckeditor5-toolbar-item-heading', 'ArrowUp');
    $assert_session->assertWaitOnAjaxRequest();

    // The heading plugin config form should no longer be present.     $assert_session->elementNotExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-heading"]');
    // The plugin settings wrapper should still be present, but empty.     $assert_session->elementExists('css', '#plugin-settings-wrapper');
    $assert_session->elementNotContains('css', '#plugin-settings-wrapper', '<div');

    // Enable the source plugin.     $this->triggerKeyUp('.ckeditor5-toolbar-item-sourceEditing', 'ArrowDown');
    $assert_session->assertWaitOnAjaxRequest();

    // The source plugin config form should be present.     $assert_session->elementExists('css', '[data-drupal-selector="edit-editor-settings-plugins-ckeditor5-sourceediting"]');

    // The filter-dependent configurable plugin should not be present.     $assert_session->elementNotExists('css', '[data-drupal-selector="edit-editor-settings-plugins-media-media"]');

    
->toString();
    $this->assertSession()->elementContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    $this->assertSession()->linkByHrefExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);

    // Make the published state a default state and ensure it is no longer     // linked.     \Drupal::state()->set('workflow_type_test.required_states', ['published']);
    $this->getSession()->reload();
    $this->assertSession()->linkByHrefNotExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);
    $this->assertSession()->elementNotContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    \Drupal::state()->set('workflow_type_test.required_states', []);
    $this->getSession()->reload();
    $this->assertSession()->elementContains('css', 'tr[data-drupal-selector="edit-states-published"]', 'Delete');
    $this->assertSession()->linkByHrefExists($published_delete_link);
    $this->assertSession()->linkByHrefExists($draft_delete_link);

    // Delete the Draft state.     $this->clickLink('Delete');
    $this->assertSession()->pageTextContains('Are you sure you want to delete Draft from Test?');
    $this->submitForm([], 'Delete');
    $this->assertSession()->pageTextContains('State Draft deleted.');
    
/** * Asserts that the correct message was announced when entering edit mode. * * @internal */
  protected function assertAnnounceEditMode(): void {
    $web_assert = $this->assertSession();
    // Wait for contextual trigger button.     $web_assert->waitForElementVisible('css', '.contextual trigger');
    $web_assert->elementContains('css', static::ANNOUNCE_SELECTOR, 'Tabbing is constrained to a set of');
    $web_assert->elementNotContains('css', static::ANNOUNCE_SELECTOR, 'Tabbing is no longer constrained by the Contextual module.');
  }

  /** * Assert that the correct message was announced when leaving edit mode. * * @internal */
  protected function assertAnnounceLeaveEditMode(): void {
    $web_assert = $this->assertSession();
    $page = $this->getSession()->getPage();
    // Wait till all the contextual links are hidden.
/** * Asserts that the update table element HTML contains the specified text. * * @param string $text * The expected text. * * @see \Behat\Mink\WebAssert::elementNotContains() */
  protected function assertUpdateTableElementNotContains($text) {
    $this->assertSession()
      ->elementNotContains('css', $this->updateTableLocator, $text);
  }

  /** * Finds an update page element by label. * * @param string $label * The label for the update, for example "Recommended version:" or * "Latest version:". * * @return \Behat\Mink\Element\NodeElement * The update element. */
Home | Imprint | This part of the site doesn't use cookies.