From a84a55bd456f25b8aa480d21c16d3bf429871926 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 19 Feb 2021 08:33:20 +0800 Subject: [PATCH] MDL-64554 user: Fix use of Private files page on classic The "Private files" link does not exist in the site navigation when using the classic theme, so it is not possible to test the dedicated page via Behat at this time. --- files/tests/behat/license_help_modal.feature | 7 ++- repository/tests/behat/delete_files.feature | 54 ++++++++++++-------- theme/classic/tests/behat/blacklist.json | 3 +- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/files/tests/behat/license_help_modal.feature b/files/tests/behat/license_help_modal.feature index 38cf2e24ce2..adde7b3f0e4 100644 --- a/files/tests/behat/license_help_modal.feature +++ b/files/tests/behat/license_help_modal.feature @@ -8,7 +8,6 @@ Feature: View licence links Scenario: Uploading a file displays licence list modal Given I log in as "admin" And I follow "Manage private files..." - And I wait until the page is ready And I follow "Add..." And I follow "Upload a file" And I click on "Help with Choose licence" "icon" in the "File picker" "dialogue" @@ -17,11 +16,11 @@ Feature: View licence links @javascript @_file_upload Scenario: Altering a file should display licence list modal Given I log in as "admin" - And I follow "Private files" + And I follow "Manage private files..." And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I press "Save changes" - And I follow "Private files" - And I click on "empty.txt" "link" + And I follow "Manage private files..." + And I click on "empty.txt" "link" in the "Manage private files" "dialogue" And I click on "Help with Choose licence" "icon" Then I should see "Follow these links for further information on the available licence options:" diff --git a/repository/tests/behat/delete_files.feature b/repository/tests/behat/delete_files.feature index dc683ed158e..c1627fa7d83 100644 --- a/repository/tests/behat/delete_files.feature +++ b/repository/tests/behat/delete_files.feature @@ -7,61 +7,69 @@ Feature: Delete files and folders from the file manager @javascript @_bug_phantomjs Scenario: Delete a file and a folder Given I log in as "admin" - And I follow "Private files" + And I follow "Manage private files..." And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I create "Delete me" folder in "Files" filemanager And I press "Save changes" + And I follow "Manage private files..." When I delete "empty.txt" from "Files" filemanager And I press "Save changes" - Then I should not see "empty.txt" + And I follow "Manage private files..." + Then I should not see "empty.txt" in the "Manage private files" "dialogue" And I delete "Delete me" from "Files" filemanager And I press "Save changes" - And I should not see "Delete me" + And I follow "Manage private files..." + And I should not see "Delete me" in the "Manage private files" "dialogue" @javascript Scenario: Delete a file and a folder using bulk functionality (individually) Given I log in as "admin" - And I follow "Private files" + And I follow "Manage private files..." And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I create "Delete me later" folder in "Files" filemanager And I press "Save changes" + And I follow "Manage private files..." And I click on "Display folder with file details" "link" And I set the field "Select file 'empty.txt'" to "1" When I click on "Delete" "link" Then I should see "Are you sure you want to delete the selected 1 file(s)?" When I click on "OK" "button" in the "Confirm" "dialogue" - Then I should not see "empty.txt" - But I should see "Delete me later" + Then I should not see "empty.txt" in the "Manage private files" "dialogue" + But I should see "Delete me later" in the "Manage private files" "dialogue" When I press "Save changes" - Then I should not see "empty.txt" - But I should see "Delete me later" + And I follow "Manage private files..." + Then I should not see "empty.txt" in the "Manage private files" "dialogue" + But I should see "Delete me later" in the "Manage private files" "dialogue" And I set the field "Select file 'Delete me later'" to "1" And I click on "Delete" "link" And I click on "OK" "button" in the "Confirm" "dialogue" - Then I should not see "Delete me later" + Then I should not see "Delete me later" in the "Manage private files" "dialogue" When I press "Save changes" - Then I should not see "Delete me later" + And I follow "Manage private files..." + Then I should not see "Delete me later" in the "Manage private files" "dialogue" @javascript Scenario: Delete a file and a folder using bulk functionality (multiple) Given I log in as "admin" - And I follow "Private files" + And I follow "Manage private files..." And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I create "Delete me" folder in "Files" filemanager And I create "Do not delete me" folder in "Files" filemanager And I press "Save changes" + And I follow "Manage private files..." And I click on "Display folder with file details" "link" And I set the field "Select file 'empty.txt'" to "1" And I set the field "Select file 'Delete me'" to "1" When I click on "Delete" "link" Then I should see "Are you sure you want to delete the selected 2 file(s)?" When I click on "OK" "button" in the "Confirm" "dialogue" - Then I should not see "Delete me" - And I should not see "empty.txt" - But I should see "Do not delete me" + Then I should not see "Delete me" in the "Manage private files" "dialogue" + And I should not see "empty.txt" in the "Manage private files" "dialogue" + But I should see "Do not delete me" in the "Manage private files" "dialogue" When I press "Save changes" - Then I should not see "Delete me" - And I should not see "empty.txt" + And I follow "Manage private files..." + Then I should not see "Delete me" in the "Manage private files" "dialogue" + And I should not see "empty.txt" in the "Manage private files" "dialogue" And I am on homepage Then I should not see "Delete me" in the "Private files" "block" And I should not see "empty.txt" in the "Private files" "block" @@ -70,11 +78,12 @@ Feature: Delete files and folders from the file manager @javascript Scenario: Delete files using the select all checkbox Given I log in as "admin" - And I follow "Private files" + And I follow "Manage private files..." And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager And I create "Delete me" folder in "Files" filemanager And I create "Delete me too" folder in "Files" filemanager And I press "Save changes" + And I follow "Manage private files..." And I click on "Display folder with file details" "link" When I click on "Select all/none" "checkbox" Then the following fields match these values: @@ -84,12 +93,13 @@ Feature: Delete files and folders from the file manager When I click on "Delete" "link" Then I should see "Are you sure you want to delete the selected 3 file(s)?" When I click on "OK" "button" in the "Confirm" "dialogue" - Then I should not see "Delete me" - And I should not see "empty.txt" - And I should not see "Delete me too" + Then I should not see "Delete me" in the "Manage private files" "dialogue" + And I should not see "empty.txt" in the "Manage private files" "dialogue" + And I should not see "Delete me too" in the "Manage private files" "dialogue" When I press "Save changes" - Then I should not see "Delete me" - And I should not see "empty.txt" + And I follow "Manage private files..." + Then I should not see "Delete me" in the "Manage private files" "dialogue" + And I should not see "empty.txt" in the "Manage private files" "dialogue" And I am on homepage Then I should not see "Delete me" in the "Private files" "block" And I should not see "empty.txt" in the "Private files" "block" diff --git a/theme/classic/tests/behat/blacklist.json b/theme/classic/tests/behat/blacklist.json index e37f62b6c38..061d393f62f 100644 --- a/theme/classic/tests/behat/blacklist.json +++ b/theme/classic/tests/behat/blacklist.json @@ -2,6 +2,7 @@ "features": [ "lib/tests/behat/action_menu.feature", "blocks/tests/behat/hide_blocks.feature", - "blocks/tests/behat/move_blocks.feature" + "blocks/tests/behat/move_blocks.feature", + "repository/upload/tests/behat/upload_file.feature" ] }