- Requires access to DB for testing. The easiest way to check content libraries loaded in the system, is querying 'mdl_h5p_libraries' table using:
select * from mdl_h5p_libraries
|
Test 1 (User must have proper permission in order to manage h5p content libraries)
- Login as Admin.
- Create 2 users (user1 and user2)
- Assign the 'Manager' system role to user2.
- Login as user1.
- Go to (path_to_your_instance)/h5p/libraries.php
- make sure you cannot access this page and an error message is displayed ("Sorry, but you do not currently have permissions to do that (Allow to update H5P content-type libraries).)"
- Login as user2 (manager).
- Go to (path_to_your_instance)/h5p/libraries.php
- make sure you can access this page and a form to manage the h5p content is displayed.
- Login as Admin.
- Edit the 'Manager' role. (Site administration > Users > Permissions > Define roles)
- Remove the moodle/h5p:updatelibraries capability for this role
- Login as user2 (manager)
- Go to (path_to_your_instance)/h5p/libraries.php
- make sure you cannot access this page and an error message is displayed ("Sorry, but you do not currently have permissions to do that (Allow to update H5P content-type libraries).)"
Test 2 (upload new content libraries)
- Login as Admin
- Go to Site administration -> H5P -> Manage H5P
- In the 'H5P content package' filearea upload the course-presentation.h5p file
- make sure a 'success' notification is displayed ("H5P libraries uploaded successfully")
- make sure the content libraries have been successfully uploaded.
- make sure each library from the file has it's own record in the db table h5p_libraries.
SELECT * FROM mdl_h5p_libraries
|
Following libraries should be in the result: blob, downloadify, Drop, EmbeddedJS, filesaber, flowplayer, FontAwesome, H5P.AdvancedText, H5P.Appearin, H5P.Audio, H5P.Blanks, H5p.CKEditor, H5P.ContinuousText, H5P.CoursePresentation, H5P.Dialogcards, H5P.DragNBar, H5P.DragNDrop, H5P.DragNResize, H5P.DragText, H5PEditor.ColorSelector
Take a notice of the H5P.Audio library in the db, it should have majorversion = 1 and minorversion = 3
Test 3 (update a specific content library)
(Continue after uploading the new content libraries from Test 2)
- In the 'H5P content package' filearea upload the course-presentation-updated.h5p file
- make sure a 'success' notification is displayed ("H5P libraries uploaded successfully")
- make sure the content libraries have been successfully uploaded.
- make sure each library from the file has it's own record in the db table h5p_libraries.
SELECT * FROM mdl_h5p_libraries
|
Following libraries should be in the result: blob, downloadify, Drop, EmbeddedJS, filesaber, flowplayer, FontAwesome, H5P.AdvancedText, H5P.Appearin, H5P.Audio, H5P.Blanks, H5p.CKEditor, H5P.ContinuousText, H5P.CoursePresentation, H5P.Dialogcards, H5P.DragNBar, H5P.DragNDrop, H5P.DragNResize, H5P.DragText, H5PEditor.ColorSelector
take a notice of the H5P.Audio library in the db, a new record has been created representing the new version of the H5P.Audio library (1.5)
Test 4 (upload a zip file containing libraries data)
- In the 'H5P content package' filearea upload the essay.zip file
- make sure a 'success' notification is displayed ("H5P libraries uploaded successfully")
- make sure the content libraries have been successfully uploaded.
- make sure each library from the file has it's own record in the db table h5p_libraries.
SELECT * FROM mdl_h5p_libraries
|
Following libraries should be in the result: Drop, FontAwesome, H5PEditor.RangeList, H5PEditor.ShowWhen, H5PEditor.TableList, H5PEditor.VerticalTabs, H5P.Essay
Test 5 (upload an invalid file or a zip file with an invalid content)
- In the 'H5P content package' filearea upload the TestZipRandom .zip file
- make sure an 'error' notification is displayed ("Invalid H5P content package.")
- In the 'H5P content package' filearea attempt to upload a random .jpg (random format excluding .h5p or .zip) file
- make sure the file could not be uploaded in the filearea and an alert is displayed stating the filetype cannot be accepted