From 4805a5b96f7a76681dc5a5286472d1579c4a4041 Mon Sep 17 00:00:00 2001 From: Kathrin Osswald Date: Thu, 5 Dec 2019 11:12:00 +0100 Subject: [PATCH] MDL-60975 behat tests: Added search for admin setting filepickers --- repository/upload/tests/behat/behat_repository_upload.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repository/upload/tests/behat/behat_repository_upload.php b/repository/upload/tests/behat/behat_repository_upload.php index 6a723f411bce7..74d6abf203312 100644 --- a/repository/upload/tests/behat/behat_repository_upload.php +++ b/repository/upload/tests/behat/behat_repository_upload.php @@ -204,12 +204,15 @@ protected function get_filepicker_node($filepickerelement) { $exception ); } else { - // Gets the filemanager node specified by the locator which contains the filepicker container. + // Gets the filemanager node specified by the locator which contains the filepicker container + // either for filepickers created by mform or by admin config. $filepickerelement = behat_context_helper::escape($filepickerelement); $filepickercontainer = $this->find( 'xpath', "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" . - "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')]", + "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' felement ')] |" . + "//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" . + "//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-setting ')]", $exception ); }