MDL-60975 behat tests: Added search for admin setting filepickers

This commit is contained in:
Kathrin Osswald 2019-12-05 11:12:00 +01:00
parent 800563e415
commit 4805a5b96f

View File

@ -204,12 +204,15 @@ class behat_repository_upload extends behat_base {
$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
);
}