Problem/Motivation

* @deprecated as of 2.8, will be removed in 3.0. Use the \Symfony\Component\CssSelector\CssSelectorConverter class instead.

Proposed resolution

Either use CssSelectorConverter or \Behat\Mink\Selector\CssSelector which is backward compatible.

Remaining tasks

Commit the patch.

User interface changes

None

API changes

\Symfony\Component\CssSelector\CssSelectorConverter is removed.

Data model changes

None

Comments

jibran created an issue. See original summary.

jibran’s picture

Title: Remove use of deprecated \Symfony\Component\CssSelector\CssSelectorConverter and use \Behat\Mink\Selector\CssSelector » Remove the use of deprecated CssSelectorConverter and use CssSelectorConverter instead.
Status: Active » Needs review
StatusFileSize
new6.15 KB

Let's go with CssSelectorConverter for now.

jibran’s picture

Title: Remove the use of deprecated CssSelectorConverter and use CssSelectorConverter instead. » Remove the use of deprecated CssSelector and use CssSelectorConverter instead.

:/

dawehner’s picture

Just a quick nitpick

+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -1523,4 +1523,23 @@ protected function getHtmlOutputHeaders() {
+   *   Whether HTML support should be enabled. Disable it for XML documents.
...
+   *   An optional prefix for the XPath expression.

Let's add (optional) on the documentation.

jibran’s picture

Issue tags: +Needs change record
StatusFileSize
new759 bytes
new6.15 KB

There you go. We need a change notice for this as well so contrib can adapt.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Fair

jibran’s picture

Title: Remove the use of deprecated CssSelector and use CssSelectorConverter instead. » Remove the use of deprecated CssSelector and use CssSelectorConverter instead
Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -1523,4 +1523,23 @@ protected function getHtmlOutputHeaders() {
+  protected function cssSelect($selector, $html = TRUE, $prefix = 'descendant-or-self::') {

This doesn't do a cssSelect - it converts a css selector to an xpath. So I guess a method name like cssSelectToXpath() is better.

jibran’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record
StatusFileSize
new3.16 KB
new6.19 KB

Done.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

looks good!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 852f0bd and pushed to 8.1.x and 8.2.x. Thanks!

I've committed this to 8.1.x as well since there is no BC breaking change and JTB and BTB are both experimental so keeping the code aligned makes everyone's life easier.

  • alexpott committed 2bef956 on 8.2.x
    Issue #2720869 by jibran: Remove the use of deprecated CssSelector and...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.