mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-66378 behat: JS does not work with newlines in an xpath
This commit is contained in:
parent
221bfed37b
commit
460a0a74c4
1 changed files with 7 additions and 2 deletions
|
@ -856,8 +856,13 @@ class behat_general extends behat_base {
|
|||
list($preselector, $prelocator) = $this->transform_selector($preselectortype, $preelement);
|
||||
list($postselector, $postlocator) = $this->transform_selector($postselectortype, $postelement);
|
||||
|
||||
$prexpath = $this->find($preselector, $prelocator, false, $containernode)->getXpath();
|
||||
$postxpath = $this->find($postselector, $postlocator, false, $containernode)->getXpath();
|
||||
$newlines = [
|
||||
"\r\n",
|
||||
"\r",
|
||||
"\n",
|
||||
];
|
||||
$prexpath = str_replace($newlines, ' ', $this->find($preselector, $prelocator, false, $containernode)->getXpath());
|
||||
$postxpath = str_replace($newlines, ' ', $this->find($postselector, $postlocator, false, $containernode)->getXpath());
|
||||
|
||||
if ($this->running_javascript()) {
|
||||
// The xpath to do this was running really slowly on certain Chrome versions so we are using
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue