MDL-68758 core_repository: Allow ability to download files on all views.
[moodle.git] / repository / tests / behat / delete_files.feature
CommitLineData
561e9bb9 1@core @core_filepicker @_file_upload
693969b5
DM
2Feature: Delete files and folders from the file manager
3 In order to clean the file manager contents
5d7b6307 4 As a user
693969b5
DM
5 I need to delete files from file areas
6
8cf30a37 7 @javascript @_bug_phantomjs
693969b5
DM
8 Scenario: Delete a file and a folder
9 Given I log in as "admin"
4887d152 10 And I follow "Manage private files"
07622451 11 And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
cde67a83 12 And I create "Delete me" folder in "Files" filemanager
693969b5 13 And I press "Save changes"
4887d152 14 And I follow "Manage private files"
cde67a83 15 When I delete "empty.txt" from "Files" filemanager
8b30d055 16 And I press "Save changes"
693969b5 17 Then I should not see "empty.txt"
4887d152 18 And I follow "Manage private files"
cde67a83 19 And I delete "Delete me" from "Files" filemanager
8b30d055 20 And I press "Save changes"
693969b5 21 And I should not see "Delete me"
2f039236
P
22
23 @javascript
24 Scenario: Delete a file and a folder using bulk functionality (individually)
25 Given I log in as "admin"
26 And I follow "Manage private files"
27 And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
06dc3a6c 28 And I create "Delete me later" folder in "Files" filemanager
2f039236
P
29 And I press "Save changes"
30 And I follow "Manage private files"
06dc3a6c
PD
31 And I click on "Display folder with file details" "link"
32 And I set the field "Select file 'empty.txt'" to "1"
31788c8c 33 When I click on "Delete" "link"
06dc3a6c
PD
34 Then I should see "Are you sure you want to delete the selected 1 file(s)?"
35 When I click on "OK" "button" in the "Confirm" "dialogue"
2f039236 36 Then I should not see "empty.txt"
06dc3a6c
PD
37 But I should see "Delete me later"
38 When I press "Save changes"
2f039236
P
39 And I follow "Manage private files"
40 Then I should not see "empty.txt"
06dc3a6c
PD
41 But I should see "Delete me later"
42 And I set the field "Select file 'Delete me later'" to "1"
31788c8c 43 And I click on "Delete" "link"
06dc3a6c
PD
44 And I click on "OK" "button" in the "Confirm" "dialogue"
45 Then I should not see "Delete me later"
46 When I press "Save changes"
47 Then I should not see "Delete me later"
2f039236
P
48
49 @javascript
50 Scenario: Delete a file and a folder using bulk functionality (multiple)
51 Given I log in as "admin"
52 And I follow "Manage private files"
53 And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
54 And I create "Delete me" folder in "Files" filemanager
06dc3a6c 55 And I create "Do not delete me" folder in "Files" filemanager
2f039236
P
56 And I press "Save changes"
57 And I follow "Manage private files"
06dc3a6c
PD
58 And I click on "Display folder with file details" "link"
59 And I set the field "Select file 'empty.txt'" to "1"
60 And I set the field "Select file 'Delete me'" to "1"
31788c8c 61 When I click on "Delete" "link"
06dc3a6c
PD
62 Then I should see "Are you sure you want to delete the selected 2 file(s)?"
63 When I click on "OK" "button" in the "Confirm" "dialogue"
2f039236 64 Then I should not see "Delete me"
06dc3a6c
PD
65 And I should not see "empty.txt"
66 But I should see "Do not delete me"
67 When I press "Save changes"
68 Then I should not see "Delete me" in the "Private files" "block"
69 And I should not see "empty.txt" in the "Private files" "block"
70 But I should see "Do not delete me" in the "Private files" "block"
71
72 @javascript
73 Scenario: Delete files using the select all checkbox
74 Given I log in as "admin"
75 And I follow "Manage private files"
76 And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager
77 And I create "Delete me" folder in "Files" filemanager
78 And I create "Delete me too" folder in "Files" filemanager
2f039236 79 And I press "Save changes"
06dc3a6c
PD
80 And I follow "Manage private files"
81 And I click on "Display folder with file details" "link"
546d9047 82 When I click on "Select all/none" "checkbox"
06dc3a6c
PD
83 Then the following fields match these values:
84 | Select file 'empty.txt' | 1 |
85 | Select file 'Delete me' | 1 |
86 | Select file 'Delete me too' | 1 |
31788c8c 87 When I click on "Delete" "link"
06dc3a6c
PD
88 Then I should see "Are you sure you want to delete the selected 3 file(s)?"
89 When I click on "OK" "button" in the "Confirm" "dialogue"
90 Then I should not see "Delete me"
91 And I should not see "empty.txt"
92 And I should not see "Delete me too"
93 When I press "Save changes"
94 Then I should not see "Delete me" in the "Private files" "block"
95 And I should not see "empty.txt" in the "Private files" "block"
4288e2ca 96 And I should not see "Delete me too" in the "Private files" "block"