MDL-42625 behat: Fixing ExpectationException::__construct() call
Also adding an extra checking to the selector to ensure it is no updating the list of files.
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
1562e8d3eb
commit
a80eba9500
@@ -272,9 +272,16 @@ class behat_filepicker extends behat_files {
|
||||
*/
|
||||
public function i_should_see_elements_in_filemanager($elementscount, $filemanagerelement) {
|
||||
$filemanagernode = $this->get_filepicker_node($filemanagerelement);
|
||||
$elements = $this->find_all('css', '.fp-content .fp-file', false, $filemanagernode);
|
||||
|
||||
// We count .fp-file elements inside a filemanager not being updated.
|
||||
$xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' filemanager ')]" .
|
||||
"[not(contains(concat(' ', normalize-space(@class), ' '), ' fm-updating '))]" .
|
||||
"//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-content ')]" .
|
||||
"//div[contains(concat(' ', normalize-space(@class), ' '), ' fp-file ')]";
|
||||
|
||||
$elements = $this->find_all('xpath', $xpath, false, $filemanagernode);
|
||||
if (count($elements) != $elementscount) {
|
||||
throw new ExpectationException('Found '.count($elements).' elements in filemanager instead of expected '.$elementscount);
|
||||
throw new ExpectationException('Found '.count($elements).' elements in filemanager instead of expected '.$elementscount, $this->getSession());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user