diff --git a/h5p/templates/h5plibraries.mustache b/h5p/templates/h5plibraries.mustache index e9c974d12dd..3ac8ee5436c 100644 --- a/h5p/templates/h5plibraries.mustache +++ b/h5p/templates/h5plibraries.mustache @@ -86,7 +86,7 @@
- +
diff --git a/h5p/tests/behat/h5p_libraries.feature b/h5p/tests/behat/h5p_libraries.feature new file mode 100644 index 00000000000..103c057612c --- /dev/null +++ b/h5p/tests/behat/h5p_libraries.feature @@ -0,0 +1,46 @@ +@editor @core_h5p @_file_upload +Feature: Upload and list H5P libraries and content types installed + + @javascript + Scenario: No library installed in new installations. + Given I log in as "admin" + When I navigate to "H5P > Manage H5P content types" in site administration + Then I should see "Upload H5P content types" + And I should not see "Installed H5P" + + @javascript + Scenario: Upload an invalid content type. + Given I log in as "admin" + And I navigate to "H5P > Manage H5P content types" in site administration + When I upload "h5p/tests/fixtures/h5ptest.zip" file to "H5P content type" filemanager + And I click on "Upload H5P content types" "button" in the "#fitem_id_submitbutton" "css_element" + And I wait until the page is ready + Then I should see "Invalid H5P content type" + And I should not see "Installed H5P" + + @javascript + Scenario: Upload a valid content type. + Given I log in as "admin" + And I navigate to "H5P > Manage H5P content types" in site administration + When 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_submitbutton" "css_element" + And I wait until the page is ready + Then I should see "H5P content types uploaded successfully" + And I should see "Installed H5P" + And I should see "Installed H5P content types" + And I should see "Fill in the Blanks" + And I should not see "Essay" + And I should see "Installed H5P libraries" + And I click on "Installed H5P libraries" "link" + And I should see "Question" + And I should see "1.4" in the "Question" "table_row" + And I should not see "1.3" in the "Question" "table_row" + And I upload "h5p/tests/fixtures/essay.zip" file to "H5P content type" filemanager + And I click on "Upload H5P content types" "button" in the "#fitem_id_submitbutton" "css_element" + And I wait until the page is ready +# Existing content types are kept and new added + And I should see "Fill in the Blanks" + And I should see "Essay" + And I click on "Installed H5P libraries" "link" + And I should see "1.3" in the "Question" "table_row" + And I should see "1.4" diff --git a/h5p/tests/fixtures/essay.zip b/h5p/tests/fixtures/essay.zip new file mode 100644 index 00000000000..59e377c7177 Binary files /dev/null and b/h5p/tests/fixtures/essay.zip differ diff --git a/h5p/tests/fixtures/filltheblanks.h5p b/h5p/tests/fixtures/filltheblanks.h5p new file mode 100644 index 00000000000..45a01d3b462 Binary files /dev/null and b/h5p/tests/fixtures/filltheblanks.h5p differ
{{#str}}description, core{{/str}}