uncheck example

    // by the Mink driver). This workaround allows the delete form to be     // submitted.     $assert_session->elementExists('css', 'form')->submit();
    $assert_session->pageTextNotContains('Dog');
    $assert_session->pageTextContains('Cat');

    // Test the 'Select all media' checkbox and assert that it makes the     // expected announcements.     $select_all = $this->waitForFieldExists('Select all media');
    $select_all->check();
    $this->waitForText('All 7 items selected');
    $select_all->uncheck();
    $this->waitForText('Zero items selected');
    $select_all->check();
    $page->selectFieldOption('Action', 'media_delete_action');
    $this->submitForm([], 'Apply to selected items');
    // For reasons that are not clear, deleting media items by pressing the     // "Delete" button can fail (the button is found, but never actually pressed     // by the Mink driver). This workaround allows the delete form to be     // submitted.     $assert_session->elementExists('css', 'form')->submit();

    $assert_session->pageTextNotContains('Cat');
    
$page->uncheckField('node_bulk_form[1]');
    $this->assertNotNull($assert_session->waitForElementVisible('css', ".js-views-bulk-actions-status:contains(\"$no_items_selected\")"));
    $this->assertNotNull($assert_session->waitForElement('css', "#drupal-live-announce:contains(\"$no_items_selected\")"));
    $assert_session->pageTextNotContains($vbo_available_message);
    $this->assertFalse($select_all->isChecked());

    $select_all->check();
    $this->assertNotNull($assert_session->waitForElementVisible('css', ".js-views-bulk-actions-status:contains(\"$two_items_selected\")"));
    $this->assertNotNull($assert_session->waitForElement('css', "#drupal-live-announce:contains(\"$vbo_available_message\")"));
    $this->assertNotNull($assert_session->waitForElement('css', "#drupal-live-announce:contains(\"$two_items_selected\")"));

    $select_all->uncheck();
    $this->assertNotNull($assert_session->waitForElementVisible('css', ".js-views-bulk-actions-status:contains(\"$no_items_selected\")"));
    $this->assertNotNull($assert_session->waitForElement('css', "#drupal-live-announce:contains(\"$no_items_selected\")"));
    $assert_session->pageTextNotContains($vbo_available_message);
  }

}
$this->assertFalse($checkboxes_some_disabled_element_value2->hasAttribute('disabled'));
    $this->assertTrue($checkboxes_some_disabled_element_value3->hasAttribute('disabled'));
    $this->assertEquals('value1', $radios_checked_element->getValue());
    // Both of these should now be disabled.     $this->assertTrue($radios_all_disabled_value1->hasAttribute('disabled'));
    $this->assertTrue($radios_all_disabled_value2->hasAttribute('disabled'));
    // Only value1 should be disabled, value 2 should remain enabled.     $this->assertTrue($radios_some_disabled_value1->hasAttribute('disabled'));
    $this->assertFalse($radios_some_disabled_value2->hasAttribute('disabled'));

    // Change state: uncheck the checkbox.     $trigger->uncheck();
    // Verify triggered state, which should match the initial state.     $this->assertTrue($textfield_invisible_element->isVisible());
    $this->assertFalse($details->hasAttribute('open'));
    $this->assertFalse($textfield_in_details->isVisible());
    $this->assertFalse($textfield_required_element->hasAttribute('required'));
    $this->assertFalse($textfield_readonly_element->hasAttribute('readonly'));
    $this->assertFalse($textarea_readonly_element->hasAttribute('readonly'));
    $this->assertFalse($checkbox_checked_element->isChecked());
    $this->assertTrue($checkbox_unchecked_element->isChecked());
    $this->assertFalse($checkbox_visible_element->isVisible());
    $this->assertTrue($text_format_invisible_value->isVisible());
    
$this->assertEquals('Title', $title_options[0]->getText());

    // Also select the target bundle so that field_text is also available.     $page->findField('settings[handler_settings][target_bundles][' . $this->targetType . ']')->setValue($this->targetType);
    $assert_session->assertWaitOnAjaxRequest();
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'nid');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'title');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'body.value');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'field_text.value');

    // Select only the target bundle. The options should be the same.     $page->findField('settings[handler_settings][target_bundles][' . $this->type . ']')->uncheck();
    $assert_session->assertWaitOnAjaxRequest();
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'nid');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'title');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'body.value');
    $assert_session->optionExists('settings[handler_settings][sort][field]', 'field_text.value');
    // Exception: the title option has a different label.     $title_options = $sort_by->findAll('xpath', 'option[@value="title"]');
    $this->assertEquals(1, count($title_options));
    $this->assertEquals($this->targetType . ' title', $title_options[0]->getText());

    // Test the sort settings.
$this->drupalCreateContentType(['type' => 'test']);
  }

  /** * Tests a vertical tab 'Workflow' summary. */
  public function testWorkflowSummary() {
    $this->drupalGet('admin/structure/types/manage/test');
    $page = $this->getSession()->getPage();
    $page->find('css', 'a[href="#edit-workflow"]')->click();
    $this->assertSession()->waitForElementVisible('css', '[name="options[status]"]');
    $page->findField('options[status]')->uncheck();
    $page->findField('options[sticky]')->check();
    $page->findField('options[promote]')->check();
    $page->findField('options[revision]')->check();
    $locator = '[href="#edit-workflow"] .vertical-tabs__menu-item-summary';
    $this->assertTrue($page->waitFor(10, function D) use ($page$locator) {
      $summary = $page->find('css', $locator)->getText();
      return str_contains($summary, 'Not published');
    }));
    $summary = $page->find('css', $locator)->getText();
    $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);
  }

}


  /** * De-selects an item in the media library modal. * * @param int $index * The zero-based index of the item to unselect. */
  protected function deselectMediaItem(int $index): void {
    $checkboxes = $this->getCheckboxes();
    $this->assertGreaterThan($indexcount($checkboxes));
    $checkboxes[$index]->uncheck();
  }

  /** * Switches to the grid display of the widget view. */
  protected function switchToMediaLibraryGrid() {
    $this->getSession()->getPage()->clickLink('Grid');
    // Assert the display change is correctly announced for screen readers.     $this->waitForText('Loading grid view.');
    $this->waitForText('Changed to grid view.');
    $this->assertMediaLibraryGrid();
  }
// Confirm endpoint can be enabled.     $this->assertSession()->fieldExists('edit-enable-endpoint')->check();
    $this->submitForm([], 'Save configuration');
    $this->assertSession()
      ->pageTextContains('The configuration options have been saved.');
    $this->assertSession()->fieldExists('edit-enable-endpoint')->isChecked();
    $is_endpoint_enabled = $this->config('system.feature_flags')->get('linkset_endpoint');
    $this->assertTrue($is_endpoint_enabled, 'Endpoint is enabled.');

    // Confirm endpoint can be disabled.     $this->assertSession()->fieldExists('edit-enable-endpoint')->uncheck();
    $this->submitForm([], 'Save configuration');
    $this->assertSession()
      ->pageTextContains('The configuration options have been saved.');
    $is_endpoint_enabled = $this->config('system.feature_flags')->get('linkset_endpoint');
    $this->assertFalse($is_endpoint_enabled, 'Endpoint is disabled.');
  }

}
Home | Imprint | This part of the site doesn't use cookies.