Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_contentbank @core_h5p @contenttype_h5p @_switch_iframe @javascriptFeature: H5P file upload to content bank for adminsIn order import new H5P content to content bankAs an adminI need to be able to upload a new .h5p file to content bankBackground:Given the following "user private file" exists:| user | admin || filepath | h5p/tests/fixtures/filltheblanks.h5p |And I log in as "admin"And I turn editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"Scenario: Admins can upload .h5p extension files to content bankGiven I should not see "filltheblanks.h5p"When 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"And I click on "filltheblanks.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyThen I should see "filltheblanks.h5p"Scenario: Admins can see uploaded H5P contentsGiven I should not see "filltheblanks.h5p"When 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"And I click on "filltheblanks.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyAnd I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "Of which countries"Scenario: Users can't see content managed by disabled pluginsGiven 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"And I click on "filltheblanks.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyAnd I should see "filltheblanks.h5p"And I navigate to "Plugins > Content bank > Manage content types" in site administrationAnd I click on "Disable" "icon" in the "H5P" "table_row"And I wait until the page is readyWhen I navigate to "Plugins > Content bank" in site administrationThen I should not see "filltheblanks.h5p"Scenario: Contents in a context are not available from other contextsGiven the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 |When 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"And I click on "filltheblanks.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyThen I should see "filltheblanks.h5p"And I am on "Course 1" course homepageAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I should not see "filltheblanks.h5p"Scenario: Admins can upload and deployed content types when libraries are not installedGiven I navigate to "H5P > Manage H5P content types" in site administrationAnd I should not see "Fill in the Blanks"And I follow "Dashboard"And I expand "Site pages" nodeAnd I click on "Content bank" "link"And I should not see "filltheblanks.h5p"When 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"And I click on "filltheblanks.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "Of which countries"And I switch to the main frameAnd I navigate to "H5P > Manage H5P content types" in site administrationAnd I should see "Fill in the Blanks"Scenario: Uploading invalid packages throws errorGiven 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" nodeAnd I click on "Content bank" "link"When 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"And I click on "no-json-file.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyThen I should see "A valid main h5p.json file is missing"And I should see "Only files with the following extensions are allowed"And I should not see "Sorry, this file is not valid"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"And I click on "unzippable.h5p" "link"And I click on "Select this file" "button"And I click on "Save changes" "button"And I wait until the page is readyAnd I should see "It is not possible to unzip it"And I should not see "Sorry, this file is not valid"