Behat failure with repeated use of filemanagers

Behat failure with repeated use of filemanagers

by Mark Johnson -
Number of replies: 1
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've got an odd issue and I was wondering if anyone else has come across it, or could reproduce it.

I have a behat test that creates several records using an mform containing a filemanager element.  The test looks rougly like this:

Given I follow "Link to form"
And I set the following fields to these values:
| Title       | foo |
| Description | bar |
And I upload "test/file1.jpg" to the "Browse file to upload" filemanager
And I press "Save Changes"
And I follow "Link to form"
And I set the following fields to these values:
| Title      | foo |
| Description | bar |
And I upload "test/file2.jpg" to the "Browse file to upload" filemanager
And I press "Save Changes"
The first upload and form submission works fine.  However, the second fails.  The file picker is opened and "Upload a file" selected, but instead of the file being attached to the Attachement field, the error "No file attached" is displayed and the test fails.  It seems that for some reason, the "Upload this file" button is being pressed before the file is attached, but not on the first time round. Has anyone else seen this problem?
I can reproduce the issue in both Firefox and Chrome.
Average of ratings: -
In reply to Mark Johnson

Re: Behat failure with repeated use of filemanagers

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It appears that this is unrelated to behat, as I've managed to reproduce it manually.

The video below demonstrates the issue. Can anyone else reproduce it, or suggest a cause?