Merge branch 'MDL-69897-310' of https://github.com/paulholden/moodle into MOODLE_310_...
authorSara Arjona <sara@moodle.com>
Mon, 19 Oct 2020 16:14:54 +0000 (18:14 +0200)
committerSara Arjona <sara@moodle.com>
Mon, 19 Oct 2020 16:14:54 +0000 (18:14 +0200)
lib/form/filemanager.js
repository/tests/behat/behat_filepicker.php

index 036233b..e70d24d 100644 (file)
@@ -924,10 +924,12 @@ M.form_filemanager.init = function(Y, options) {
             }, this);
             selectnode.one('.fp-file-delete').on('click', function(e) {
                 e.preventDefault();
-                var dialog_options = {};
+                var dialog_options = {
+                    scope: this,
+                    header: M.util.get_string('confirm', 'moodle'),
+                };
                 var params = {};
                 var fileinfo = this.selectui.fileinfo;
-                dialog_options.scope = this;
                 params.filepath = fileinfo.filepath;
                 if (fileinfo.type == 'folder') {
                     params.filename = '.';
index 2a56474..ca8fffe 100644 (file)
@@ -172,9 +172,7 @@ class behat_filepicker extends behat_base {
         $this->perform_on_element('delete', $exception);
 
         // Yes, we are sure.
-        // Using xpath + click instead of pressButton as 'Ok' it is a common string.
-        $okbutton = $this->find('css', 'div.fp-dlg button.fp-dlg-butconfirm');
-        $okbutton->click();
+        $this->execute('behat_general::i_click_on_in_the', [get_string('ok'), 'button', get_string('confirm'), 'dialogue']);
     }
 
     /**