MDL-72849 tool_behat: Use of xpath name() not compatible with Firefox

The xpath name() function returns upper-case e.g. 'IMG' in Firefox and
lower-case e.g. 'img' in Chrome.
This commit is contained in:
sam marshall 2021-10-19 13:47:20 +01:00
parent 1a9bee69e6
commit 8b8ef39802
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ class behat_exact_named_selector extends \Behat\Mink\Selector\ExactNamedSelector
* Creates selector instance.
*/
public function __construct() {
$this->registerReplacement('%iconMatch%', "(contains(concat(' ', @class, ' '), ' icon ') or name() = 'img')");
$this->registerReplacement('%iconMatch%', "(contains(concat(' ', @class, ' '), ' icon ') or self::img)");
$this->registerReplacement('%imgAltMatch%', './/*[%iconMatch% and (%altMatch% or %titleMatch%)]');
parent::__construct();
}

View File

@ -52,7 +52,7 @@ class behat_partial_named_selector extends \Behat\Mink\Selector\PartialNamedSele
$this->registerReplacement($from, implode(' or ', $tos));
}
$this->registerReplacement('%iconMatch%', "(contains(concat(' ', @class, ' '), ' icon ') or name() = 'img')");
$this->registerReplacement('%iconMatch%', "(contains(concat(' ', @class, ' '), ' icon ') or self::img)");
$this->registerReplacement('%imgAltMatch%', './/*[%iconMatch% and (%altMatch% or %titleMatch%)]');
parent::__construct();
}