mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-68353 test: Update filemanager/filepicker xpath selector
This commit is contained in:
parent
9b6efe3aea
commit
58994fe8bb
@ -255,7 +255,7 @@ XPATH
|
||||
,
|
||||
'filemanager' => <<<XPATH
|
||||
.//*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']
|
||||
/descendant::input[@id = //label[contains(normalize-space(string(.)), %locator%)]/@for]
|
||||
/descendant::input[@id = substring-before(//p[contains(normalize-space(string(.)), %locator%)]/@id, '_label')]
|
||||
XPATH
|
||||
,
|
||||
'passwordunmask' => <<<XPATH
|
||||
|
@ -74,7 +74,7 @@ trait core_behat_file_helper {
|
||||
$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::*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']",
|
||||
$exception
|
||||
);
|
||||
|
@ -68,7 +68,7 @@ class behat_form_filemanager extends behat_form_field {
|
||||
$fieldlabel = $this->get_field_locator();
|
||||
|
||||
// Get the name of the current directory elements.
|
||||
$xpath = "//label[contains(., '" . $fieldlabel . "')]" .
|
||||
$xpath = "//p[normalize-space(.)='$fieldlabel']" .
|
||||
"/ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')]" .
|
||||
"/descendant::div[@data-fieldtype = 'filemanager']" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' fp-filename ')]";
|
||||
|
@ -209,10 +209,8 @@ class behat_repository_upload extends behat_base {
|
||||
$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 ')] |" .
|
||||
"//input[./@id = //label[normalize-space(.)=$filepickerelement]/@for]" .
|
||||
"//ancestor::div[contains(concat(' ', normalize-space(@class), ' '), ' form-setting ')]",
|
||||
"//input[./@id = substring-before(//p[normalize-space(.)=$filepickerelement]/@id, '_label')]" .
|
||||
"//ancestor::*[@data-fieldtype = 'filemanager' or @data-fieldtype = 'filepicker']",
|
||||
$exception
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user