MDL-38950 behat: New tests
[moodle.git] / repository / tests / behat / cancel_add_file.feature
blobd9604f7ee714c83e5d1f8147d4876df391cbb32f
1 @repository @_only_local
2 Feature: A selected file can be cancelled
3   In order to refine the file manager contents
4   As a moodle user
5   I need to cancel a selected file
7   @javascript
8   Scenario: Cancel a selected recent file from being added to a folder
9     Given the following "courses" exists:
10       | fullname | shortname | category |
11       | Course 1 | C1 | 0 |
12     And I log in as "admin"
13     And I expand "My profile" node
14     And I follow "My private files"
15     And I upload "lib/tests/fixtures/empty.txt" file to "Files" filepicker
16     And I press "Save changes"
17     And I am on homepage
18     And I follow "Course 1"
19     And I turn editing mode on
20     When I add a "Folder" to section "1"
21     And I fill the moodle form with:
22       | Name | Folder name |
23       | Description | Folder description |
24     And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filepicker
25     And I click on "#fitem_id_files .fp-btn-add a" "css_element"
26     And I click on "Recent files" "link" in the ".fp-repo-area" "css_element"
27     And I click on "//a[contains(concat(' ', @class, ' '), ' fp-file ')][contains(., 'empty.txt')]" "xpath_element"
28     And I wait "2" seconds
29     And I click on ".fp-select .fp-select-cancel" "css_element"
30     And I click on ".file-picker button.yui3-button-close" "css_element"
31     And I press "Save and display"
32     Then I should see "upload_users.csv"
33     And I should not see "empty.txt"
34     And I should see "Folder description"