cssSelectToXpath example

return $logged_in;
  }

  /** * Clicks the element with the given CSS selector. * * @param string $css_selector * The CSS selector identifying the element to click. */
  protected function click($css_selector) {
    $starting_url = $this->getSession()->getCurrentUrl();
    $this->getSession()->getDriver()->click($this->cssSelectToXpath($css_selector));
    // Log only for WebDriverTestBase tests because for BrowserKitDriver we log     // with ::getResponseLogHandler.     if ($this->htmlOutputEnabled && !$this->isTestUsingGuzzleClient()) {
      $out = $this->getSession()->getPage()->getContent();
      $html_output =
        'Clicked element with CSS selector: ' . $css_selector .
        '<hr />Starting URL: ' . $starting_url .
        '<hr />Ending URL: ' . $this->getSession()->getCurrentUrl();
      $html_output .= '<hr />' . $out;
      $html_output .= $this->getHtmlOutputHeaders();
      $this->htmlOutput($html_output);
    }
$save_button->click();

    // Display the "Manage display" page.     $this->drupalGet($manage_display);

    // Change the formatter and check that the summary is updated.     $page = $this->getSession()->getPage();

    $field_image_type = $page->findField('fields[field_image][type]');
    $field_image_type->setValue('responsive_image');

    $summary_text = $assert_session->waitForElement('xpath', $this->cssSelectToXpath('#field-image .ajax-new-content .field-plugin-summary'));
    $this->assertEquals('Select a responsive image style. Loading attribute: lazy', $summary_text->getText());

    $page->pressButton('Save');
    $assert_session->responseContains("Select a responsive image style.");

    // Create responsive image styles.     $responsive_image_style = ResponsiveImageStyle::create([
      'id' => 'style_one',
      'label' => 'Style One',
      'breakpoint_group' => 'responsive_image_test_module',
      'fallback_image_style' => 'thumbnail',
    ]);
Home | Imprint | This part of the site doesn't use cookies.