diff --git a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature index 8ea945320f0..b4a74c2672d 100644 --- a/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/admin_upload_content.feature @@ -1,17 +1,14 @@ -@core @core_contentbank @core_h5p @contenttype_h5p @_file_upload @_switch_iframe @javascript +@core @core_contentbank @core_h5p @contenttype_h5p @_switch_iframe @javascript Feature: H5P file upload to content bank for admins In order import new H5P content to content bank As an admin I need to be able to upload a new .h5p file to content bank Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And I log in as "admin" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" And I turn editing mode on And the following config values are set as admin: | unaddableblocks | | theme_boost| @@ -99,13 +96,11 @@ Feature: H5P file upload to content bank for admins And I should see "Fill in the Blanks" Scenario: Uploading invalid packages throws error - Given I follow "Dashboard" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/no-json-file.h5p" file to "Files" filemanager - And I click on "Save changes" "button" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/unzippable.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private files" exist: + | user | filepath | + | admin | h5p/tests/fixtures/no-json-file.h5p | + | admin | h5p/tests/fixtures/unzippable.h5p | + And I follow "Dashboard" And I expand "Site pages" node And I click on "Content bank" "link" When I click on "Upload" "link" diff --git a/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature b/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature index c527ecd78a9..6c6fd16a5ee 100644 --- a/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature +++ b/contentbank/contenttype/h5p/tests/behat/teacher_upload_content.feature @@ -19,13 +19,10 @@ Feature: H5P file upload to content bank for non admins | user | course | role | | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + And the following "user private file" exists: + | user | teacher1 | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And I log in as "teacher1" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" Scenario: Teachers can not access system level content bank Given I turn editing mode on @@ -128,11 +125,10 @@ Feature: H5P file upload to content bank for non admins And I should not see "filltheblanks.h5p" Scenario: Teachers can not see existing contents when libraries are not installed - Given I log out + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And I log in as "admin" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" And I navigate to "H5P > Manage H5P content types" in site administration And I should not see "Fill in the Blanks" When I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager diff --git a/contentbank/tests/behat/delete_content.feature b/contentbank/tests/behat/delete_content.feature index e95825d6449..5a5d17d9b98 100644 --- a/contentbank/tests/behat/delete_content.feature +++ b/contentbank/tests/behat/delete_content.feature @@ -1,18 +1,14 @@ -@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript +@core @core_contentbank @core_h5p @contentbank_h5p @javascript Feature: Delete H5P file from the content bank In order remove H5P content from the content bank As an admin I need to be able to delete any H5P content from the content bank Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | - And I log in as "admin" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" - And I am on the "Content bank" page + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | + And I am on the "Content bank" page logged in as "admin" And I click on "Upload" "link" And I click on "Choose a file..." "button" And I click on "Private files" "link" in the ".fp-repo-area" "css_element" @@ -48,12 +44,10 @@ Feature: Delete H5P file from the content bank And the following "role assigns" exist: | user | role | contextlevel | reference | | manager | manager | System | | - And I log out - And I log in as "manager" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/find-the-words.h5p" file to "Files" filemanager - And I click on "Save changes" "button" - When I am on the "Content bank" page + And the following "user private file" exists: + | user | manager | + | filepath | h5p/tests/fixtures/find-the-words.h5p | + When I am on the "Content bank" page logged in as "manager" And I should see "content2delete.h5p" And I follow "content2delete.h5p" And I wait "2" seconds @@ -71,8 +65,7 @@ Feature: Delete H5P file from the content bank And I should see "Delete" Scenario: The number of times a content is used is displayed before removing it - Given I follow "Dashboard" - And I follow "Manage private files..." + Given I am on the "My private files" page And I click on "Add..." "button" And I select "Content bank" repository in file picker And I click on "content2delete.h5p" "file" in repository content area diff --git a/contentbank/tests/behat/edit_content.feature b/contentbank/tests/behat/edit_content.feature index 65569f346a2..05209d3ca72 100644 --- a/contentbank/tests/behat/edit_content.feature +++ b/contentbank/tests/behat/edit_content.feature @@ -5,10 +5,7 @@ Feature: Content bank use editor feature I need to be able to access the edition options Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | - And I log in as "admin" + Given I log in as "admin" And I am on site homepage And I turn editing mode on And the following config values are set as admin: @@ -25,10 +22,9 @@ Feature: Content bank use editor feature Then the "[data-action=Add-content]" "css_element" should be disabled Scenario: Users can see the Add button if there is content type available for creation - Given I follow "Dashboard" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Content bank" "link" in the "Navigation" "block" And I click on "Upload" "link" @@ -44,10 +40,9 @@ Feature: Content bank use editor feature And I should see "Fill in the Blanks" Scenario: Users can edit content if they have the required permission - Given I follow "Dashboard" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And I click on "Site pages" "list_item" in the "Navigation" "block" And I click on "Content bank" "link" in the "Navigation" "block" And I click on "Upload" "link" diff --git a/contentbank/tests/behat/events.feature b/contentbank/tests/behat/events.feature index 6757d9d2133..6c4cf88d735 100644 --- a/contentbank/tests/behat/events.feature +++ b/contentbank/tests/behat/events.feature @@ -1,30 +1,23 @@ -@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @_switch_iframe @javascript +@core @core_contentbank @core_h5p @contentbank_h5p @_switch_iframe @javascript Feature: Confirm content bank events are triggered In order to log content bank actions As an admin I need to be able to check triggered events Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | - And I log in as "admin" - And I navigate to "H5P > Manage H5P content types" in site administration - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager - And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element" - And the following "courses" exist: + Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "contentbank content" exist: | contextlevel | reference | contenttype | user | contentname | filepath | | Course | C1 | contenttype_h5p | admin | Existing | /h5p/tests/fixtures/filltheblanks.h5p | - And I follow "Dashboard" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I click on "Save changes" "button" - And I am on "Course 1" course homepage with editing mode on + And the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/filltheblanks.h5p | And the following config values are set as admin: | unaddableblocks | | theme_boost| + And I log in as "admin" + And I am on "Course 1" course homepage with editing mode on And I add the "Navigation" block if not present Scenario: Content created and uploaded events when uploading a content file diff --git a/contentbank/tests/behat/view_preferences.feature b/contentbank/tests/behat/view_preferences.feature index b8d5b3d193c..b97993aaf67 100644 --- a/contentbank/tests/behat/view_preferences.feature +++ b/contentbank/tests/behat/view_preferences.feature @@ -1,18 +1,15 @@ -@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript +@core @core_contentbank @core_h5p @contentbank_h5p @javascript Feature: Store the content bank view preference In order to consistantly view the content bank in icons or details view As an admin I need to be able to store my view preference Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private files" exist: + | user | filepath | + | admin | h5p/tests/fixtures/filltheblanks.h5p | + | admin | h5p/tests/fixtures/greeting-card.h5p | And I log in as "admin" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Files" filemanager - And I upload "h5p/tests/fixtures/greeting-card.h5p" file to "Files" filemanager - And I click on "Save changes" "button" And I am on site homepage And I turn editing mode on And the following config values are set as admin: @@ -55,8 +52,7 @@ Feature: Store the content bank view preference And I should not see "Last modified" Scenario: Display the number of times a content is used in file details view - Given I follow "Dashboard" - And I follow "Manage private files..." + Given I am on the "My private files" page And I click on "Add..." "button" And I select "Content bank" repository in file picker And I click on "fib.h5p" "file" in repository content area diff --git a/filter/displayh5p/tests/behat/inline_editing_content.feature b/filter/displayh5p/tests/behat/inline_editing_content.feature index f9a26526b0c..9406d4a368a 100644 --- a/filter/displayh5p/tests/behat/inline_editing_content.feature +++ b/filter/displayh5p/tests/behat/inline_editing_content.feature @@ -1,4 +1,4 @@ -@editor @editor_atto @atto @atto_h5p @filter @filter_displayh5p @core_h5p @_file_upload @_switch_iframe +@editor @editor_atto @atto @atto_h5p @filter @filter_displayh5p @core_h5p @_switch_iframe Feature: Inline editing H5P content anywhere In order to edit an existing H5P content As a user @@ -30,23 +30,17 @@ Feature: Inline editing H5P content anywhere | capability | permission | role | contextlevel | reference | | moodle/course:update | Allow | teacher | System | | | moodle/course:update | Allow | student | System | | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | @javascript @mod @mod_page Scenario: Edit H5P content from a page using link to private file Given the following "permission overrides" exist: | capability | permission | role | contextlevel | reference | | moodle/h5p:updatelibraries | Allow | editingteacher | System | | - And I log in as "teacher1" - # Upload the H5P to private user files. - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/greeting-card.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + And the following "user private file" exists: + | user | teacher1 | + | filepath | h5p/tests/fixtures/greeting-card.h5p | # Add H5P content to the page. - And I am on "Course 1" course homepage - And I am on the "PageName1" "page activity" page + And I am on the "PageName1" "page activity" page logged in as "teacher1" And I navigate to "Settings" in current page administration And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element" And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue" diff --git a/lib/editor/atto/plugins/image/tests/behat/image.feature b/lib/editor/atto/plugins/image/tests/behat/image.feature index 1f4537c8d78..f423903f5d8 100644 --- a/lib/editor/atto/plugins/image/tests/behat/image.feature +++ b/lib/editor/atto/plugins/image/tests/behat/image.feature @@ -1,16 +1,13 @@ -@editor @editor_atto @atto @atto_image @_file_upload +@editor @editor_atto @atto @atto_image Feature: Add images to Atto To write rich text - I need to add images. @javascript Scenario: Insert an image - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private file" exists: + | user | admin | + | filepath | lib/editor/atto/tests/fixtures/moodle-logo.png | And I log in as "admin" - And I follow "Manage private files..." - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" And I open my profile in edit mode When I set the field "Description" to "
Image test
" And I select the text in the "Description" Atto editor diff --git a/lib/editor/atto/plugins/link/tests/behat/link.feature b/lib/editor/atto/plugins/link/tests/behat/link.feature index 39dab8c1158..fe21267ae7c 100644 --- a/lib/editor/atto/plugins/link/tests/behat/link.feature +++ b/lib/editor/atto/plugins/link/tests/behat/link.feature @@ -1,16 +1,13 @@ -@editor @editor_atto @atto @atto_link @_file_upload +@editor @editor_atto @atto @atto_link Feature: Add links to Atto To write rich text - I need to add links. @javascript Scenario: Insert a links - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private file" exists: + | user | admin | + | filepath | lib/editor/atto/tests/fixtures/moodle-logo.png | And I log in as "admin" - And I follow "Manage private files..." - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" When I open my profile in edit mode And I set the field "Description" to "Super cool" And I select the text in the "Description" Atto editor @@ -85,10 +82,10 @@ Feature: Add links to Atto @javascript Scenario: Insert a link for an image - Given I log in as "admin" - And I follow "Private files" in the user menu - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | admin | + | filepath | lib/editor/atto/tests/fixtures/moodle-logo.png | + And I log in as "admin" And I open my profile in edit mode And I click on "Insert or edit image" "button" And I click on "Browse repositories..." "button" diff --git a/lib/editor/atto/plugins/media/tests/behat/media.feature b/lib/editor/atto/plugins/media/tests/behat/media.feature index 2f254849086..352c6a39617 100644 --- a/lib/editor/atto/plugins/media/tests/behat/media.feature +++ b/lib/editor/atto/plugins/media/tests/behat/media.feature @@ -1,20 +1,17 @@ -@editor @editor_atto @atto @atto_media @_file_upload +@editor @editor_atto @atto @atto_media Feature: Add media to Atto To write rich text - I need to add media. Background: - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private files" exist: + | user | filepath | + | admin | lib/editor/atto/tests/fixtures/moodle-logo.webm | + | admin | lib/editor/atto/tests/fixtures/moodle-logo.mp4 | + | admin | lib/editor/atto/tests/fixtures/moodle-logo.png | + | admin | lib/editor/atto/tests/fixtures/pretty-good-en.vtt | + | admin | lib/editor/atto/tests/fixtures/pretty-good-sv.vtt | And I log in as "admin" And I change window size to "large" - And I follow "Manage private files..." - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.webm" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.mp4" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/pretty-good-en.vtt" file to "Files" filemanager - And I upload "lib/editor/atto/tests/fixtures/pretty-good-sv.vtt" file to "Files" filemanager - And I click on "Save changes" "button" And I follow "Profile" in the user menu And I follow "Blog entries" And I follow "Add a new entry" diff --git a/lib/editor/atto/tests/behat/autosave.feature b/lib/editor/atto/tests/behat/autosave.feature index d4f4379749b..d0a3b249c7c 100644 --- a/lib/editor/atto/tests/behat/autosave.feature +++ b/lib/editor/atto/tests/behat/autosave.feature @@ -1,4 +1,4 @@ -@editor @editor_atto @atto @_file_upload +@editor @editor_atto @atto Feature: Atto Autosave To reduce frustration, atto should save drafts of my work. @@ -14,9 +14,6 @@ Feature: Atto Autosave | user | course | role | | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And I log in as "admin" And I navigate to "Plugins > Text editors > Atto HTML editor > Atto toolbar settings" in site administration And I set the field "Autosave frequency" to "3" @@ -46,18 +43,16 @@ Feature: Atto Autosave @javascript Scenario: Do not restore a draft if files have been modified - Given I log in as "teacher1" - And I am on "Course 1" course homepage + Given the following "user private file" exists: + | user | teacher2 | + | filepath | lib/editor/atto/tests/fixtures/moodle-logo.png | + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Settings" in current page administration And I set the field "Course summary" to "This is my draft" # Wait for the autosave And I wait "5" seconds And I log out - And I log in as "teacher2" - And I follow "Manage private files..." - And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher2 And I navigate to "Settings" in current page administration And I set the field "Course summary" to "Image test
" And I select the text in the "Course summary" Atto editor diff --git a/lib/editor/tiny/plugins/autosave/tests/behat/autosave.feature b/lib/editor/tiny/plugins/autosave/tests/behat/autosave.feature index 9edd046cd52..573f081a493 100644 --- a/lib/editor/tiny/plugins/autosave/tests/behat/autosave.feature +++ b/lib/editor/tiny/plugins/autosave/tests/behat/autosave.feature @@ -1,4 +1,4 @@ -@editor @editor_tiny @_file_upload +@editor @editor_tiny @tiny_autosave Feature: Tiny editor autosave In order to prevent data loss As a content creator @@ -16,9 +16,6 @@ Feature: Tiny editor autosave | user | course | role | | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | @javascript Scenario: Restore a draft on user profile page @@ -32,15 +29,14 @@ Feature: Tiny editor autosave @javascript Scenario: Do not restore a draft if files have been modified - Given I am on the "Course 1" course page logged in as teacher1 + Given the following "user private file" exists: + | user | teacher2 | + | filepath | lib/editor/tiny/tests/behat/fixtures/tinyscreenshot.png | + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Settings" in current page administration And I set the field "Course summary" to "This is my draft" And I log out - And I log in as "teacher2" - And I follow "Manage private files..." - And I upload "/lib/editor/tiny/tests/behat/fixtures/tinyscreenshot.png" file to "Files" filemanager - And I click on "Save changes" "button" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher2 And I navigate to "Settings" in current page administration And I set the field "Course summary" to "Image test
" And I select the "p" element in position "1" of the "Course summary" TinyMCE editor diff --git a/lib/editor/tiny/plugins/link/tests/behat/link.feature b/lib/editor/tiny/plugins/link/tests/behat/link.feature index 45109fe9e7e..40adde36114 100644 --- a/lib/editor/tiny/plugins/link/tests/behat/link.feature +++ b/lib/editor/tiny/plugins/link/tests/behat/link.feature @@ -1,16 +1,13 @@ -@editor @editor_tiny @tiny_link @_file_upload +@editor @editor_tiny @tiny_link Feature: Add links to TinyMCE To write rich text - I need to add links. @javascript Scenario: Insert a link - Given the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | + Given the following "user private file" exists: + | user | admin | + | filepath | lib/editor/tiny/tests/behat/fixtures/moodle-logo.png | And I log in as "admin" - And I follow "Manage private files..." - And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" And I open my profile in edit mode And I set the field "Description" to "Super cool" When I select the "p" element in position "0" of the "Description" TinyMCE editor @@ -100,10 +97,10 @@ Feature: Add links to TinyMCE @javascript Scenario: Insert a link for an image using TinyMCE editor - Given I log in as "admin" - And I follow "Private files" in the user menu - And I upload "lib/editor/tiny/tests/behat/fixtures/moodle-logo.png" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | admin | + | filepath | lib/editor/tiny/tests/behat/fixtures/moodle-logo.png | + And I log in as "admin" And I open my profile in edit mode And I click on the "Image" button for the "Description" TinyMCE editor And I click on "Browse repositories..." "button" in the "Image properties" "dialogue" diff --git a/mod/h5pactivity/tests/behat/contentbank_link.feature b/mod/h5pactivity/tests/behat/contentbank_link.feature index ed75005db1e..a396f055011 100644 --- a/mod/h5pactivity/tests/behat/contentbank_link.feature +++ b/mod/h5pactivity/tests/behat/contentbank_link.feature @@ -1,4 +1,4 @@ -@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe +@mod @mod_h5pactivity @core_h5p @_switch_iframe Feature: Content bank link in the activity settings form In order to have direct access to the Content bank As a teacher @@ -17,9 +17,6 @@ Feature: Content bank link in the activity settings form And the following "contentbank content" exist: | contextlevel | reference | contenttype | user | contentname | filepath | | Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | @javascript Scenario: The content bank link should go to the course Content bank @@ -89,10 +86,10 @@ Feature: Content bank link in the activity settings form @javascript Scenario: The content bank link should go to the course Content bank if the file is referenced but to another repository - Given I log in as "admin" - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | admin | + | filepath | h5p/tests/fixtures/guess-the-answer.h5p | + When I log in as "admin" And I am on "Course 1" course homepage with editing mode on And I add a "H5P" to section "1" And I set the following fields to these values: @@ -108,5 +105,5 @@ Feature: Content bank link in the activity settings form And I switch to "h5p-iframe" class iframe And I should see "Which fruit is this?" And I switch to the main frame - When I navigate to "Settings" in current page administration + And I navigate to "Settings" in current page administration Then I should see "Use the content bank (opens in new window) to manage your H5P files" diff --git a/mod/h5pactivity/tests/behat/inline_editing_content.feature b/mod/h5pactivity/tests/behat/inline_editing_content.feature index c1878204215..bdc5beb3552 100644 --- a/mod/h5pactivity/tests/behat/inline_editing_content.feature +++ b/mod/h5pactivity/tests/behat/inline_editing_content.feature @@ -1,4 +1,4 @@ -@mod @mod_h5pactivity @core_h5p @_file_upload @_switch_iframe +@mod @mod_h5pactivity @core_h5p @_switch_iframe Feature: Inline editing H5P content In order to edit an existing H5P activity file As a teacher @@ -21,9 +21,6 @@ Feature: Inline editing H5P content And the following "permission overrides" exist: | capability | permission | role | contextlevel | reference | | moodle/h5p:updatelibraries | Allow | editingteacher | System | | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | @javascript Scenario: Add H5P activity using link to content bank file @@ -151,12 +148,11 @@ Feature: Inline editing H5P content @javascript Scenario: Add H5P activity using private user file - Given I log in as "teacher1" - # Upload the H5P to private user files. - And I follow "Manage private files..." - And I upload "h5p/tests/fixtures/greeting-card.h5p" file to "Files" filemanager - And I click on "Save changes" "button" + Given the following "user private file" exists: + | user | teacher1 | + | filepath | h5p/tests/fixtures/greeting-card.h5p | # Create an H5P activity with a private user file. + When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add a "H5P" to section "1" And I set the following fields to these values: diff --git a/question/type/essay/tests/behat/file_type_restriction.feature b/question/type/essay/tests/behat/file_type_restriction.feature index 9868575de3f..82c77b04104 100644 --- a/question/type/essay/tests/behat/file_type_restriction.feature +++ b/question/type/essay/tests/behat/file_type_restriction.feature @@ -28,10 +28,7 @@ Feature: In a essay question, limit submittable file types And quiz "Quiz 1" contains the following questions: | question | page | | TF1 | 1 | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | - Given I am on the "Quiz 1" "mod_quiz > edit" page logged in as teacher + And I am on the "Quiz 1" "mod_quiz > edit" page logged in as teacher And I click on "Edit question TF1" "link" And I set the field "Allow attachments" to "1" And I set the field "Response format" to "No online text" @@ -42,13 +39,12 @@ Feature: In a essay question, limit submittable file types And I set the field "version" to "Always latest" Then I log out - @javascript @_file_upload + @javascript Scenario: Preview an Essay question and submit a response with a correct filetype. - When I log in as "student" - 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 am on the "Quiz 1" "quiz activity" page + Given the following "user private file" exists: + | user | student | + | filepath | lib/tests/fixtures/empty.txt | + When I am on the "Quiz 1" "quiz activity" page logged in as "student" And I press "Attempt quiz" And I should see "First question" And I should see "You can drag and drop files here to add them." @@ -60,13 +56,12 @@ Feature: In a essay question, limit submittable file types And I wait until the page is ready Then I should not see "These file types are not allowed here:" - @javascript @_file_upload + @javascript Scenario: Preview an Essay question and try to submit a response with an incorrect filetype. - When I log in as "student" - And I follow "Manage private files" - And I upload "lib/tests/fixtures/upload_users.csv" file to "Files" filemanager - And I press "Save changes" - And I am on the "Quiz 1" "quiz activity" page + Given the following "user private file" exists: + | user | student | + | filepath | lib/tests/fixtures/upload_users.csv | + When I am on the "Quiz 1" "quiz activity" page logged in as "student" And I press "Attempt quiz" And I should see "First question" And I should see "You can drag and drop files here to add them."