hasLink example

$theme_container = $this->getSession()->getPage()->find('css', "h3:contains(\"$theme_name\")")->getParent();
    $requires_list_items = $theme_container->findAll('css', '.theme-info__requires li');
    $this->assertSameSize($expected_requires_list_items$requires_list_items);

    foreach ($requires_list_items as $key => $item) {
      $this->assertContains($item->getText()$expected_requires_list_items);
    }

    $incompatible = $theme_container->find('css', '.incompatible');
    $expected_incompatible_text = 'This theme requires the listed modules to operate correctly. They must first be enabled via the Extend page.';
    $this->assertSame($expected_incompatible_text$incompatible->getText());
    $this->assertFalse($theme_container->hasLink('Install Test Theme Depending on Modules theme'));
  }

  /** * Tests installing a theme with missing module dependencies. */
  public function testInstallModuleWithMissingDependencies() {
    $this->drupalGet('admin/appearance');
    $theme_container = $this->getSession()->getPage()->find('css', 'h3:contains("Test Theme Depending on Nonexisting Module")')->getParent();
    $this->assertStringContainsString('Requires: test_module_non_existing (missing)', $theme_container->getText());
    $this->assertStringContainsString('This theme requires the listed modules to operate correctly.', $theme_container->getText());
  }

  
$assert_session->pageTextContains('Twin media');
    $assert_session->pageTextContains('Single media type');
    $assert_session->pageTextContains('Empty types media');

    // Assert generic media library elements.     $this->openMediaLibraryForField('field_unlimited_media');
    $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click();

    // Assert that the media type menu is available when more than 1 type is     // configured for the field.     $menu = $this->openMediaLibraryForField('field_unlimited_media');
    $this->assertTrue($menu->hasLink('Show Type One media (selected)'));
    $this->assertFalse($menu->hasLink('Type Two'));
    $this->assertTrue($menu->hasLink('Type Three'));
    $this->assertFalse($menu->hasLink('Type Four'));
    $this->switchToMediaType('Three');
    // Assert the active tab is set correctly.     $this->assertFalse($menu->hasLink('Show Type One media (selected)'));
    $this->assertTrue($menu->hasLink('Show Type Three media (selected)'));
    // Assert the focus is set to the first tabbable element when a vertical tab     // is clicked.     $this->assertJsCondition('jQuery(tabbable.tabbable(document.getElementById("media-library-content"))[0]).is(":focus")');
    $assert_session->elementExists('css', '.ui-dialog-titlebar-close')->click();

    

  protected function assertCoreCompatibilityMessage(string $version, string $expected_range, string $expected_release_title, bool $is_compatible = TRUE): void {
    $update_element = $this->findUpdateElementByLabel($expected_release_title);
    $this->assertTrue($update_element->hasLink($version));
    $compatibility_details = $update_element->find('css', '.project-update__compatibility-details details');
    $this->assertStringContainsString("Requires Drupal core: $expected_range", $compatibility_details->getText());
    $details_summary_element = $compatibility_details->find('css', 'summary');
    if ($is_compatible) {
      // If an update is compatible with the installed version of Drupal core,       // the details element should be closed by default.       $this->assertFalse($compatibility_details->hasAttribute('open'));
      $this->assertSame('Compatible', $details_summary_element->getText());
    }
    else {
      // If an update is not compatible with the installed version of Drupal
'id' => 'test_workspace',
      'label' => 'Test workspace',
    ], 'Save');

    // Activate the test workspace.     $this->drupalGet('/admin/config/workflow/workspaces/manage/test_workspace/activate');
    $this->submitForm([], 'Confirm');

    $this->drupalGet('<front>');
    $page = $this->getSession()->getPage();
    // Toolbar should show the correct label.     $this->assertTrue($page->hasLink('Test workspace'));

    // Change the workspace label.     $this->drupalGet('/admin/config/workflow/workspaces/manage/test_workspace/edit');
    $this->submitForm(['label' => 'New name'], 'Save');

    $this->drupalGet('<front>');
    $page = $this->getSession()->getPage();
    // Toolbar should show the new label.     $this->assertTrue($page->hasLink('New name'));
  }

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