MDL-68353 theme_classic: Update filepicker xpath selector
authorShamim Rezaie <shamim@moodle.com>
Sun, 31 May 2020 14:12:33 +0000 (00:12 +1000)
committerShamim Rezaie <shamim@moodle.com>
Sun, 31 May 2020 14:14:10 +0000 (00:14 +1000)
theme/classic/tests/behat/behat_theme_classic_behat_repository_upload.php

index 369b91e..365548f 100644 (file)
@@ -59,11 +59,11 @@ class behat_theme_classic_behat_repository_upload extends behat_repository_uploa
                 $exception
             );
         } else {
-            // Gets the ffilemanager node specified by the locator which contains the filepicker container.
+            // Gets the filemanager node specified by the locator which contains the filepicker container.
             $filepickerelement = behat_context_helper::escape($filepickerelement);
             $filepickercontainer = $this->find(
                 'xpath',
-                "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" .
+                "//input[./@id = substring-before(//p[normalize-space(.)=$filepickerelement]/@id, '_label')]" .
                     "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')]",
                 $exception
             );