Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_contentbank @core_h5p @contenttype_h5p @_file_upload @_switch_iframe @javascriptFeature: H5P file upload to content bank for non 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 "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || teacher2 | Teacher | 2 | teacher2@example.com |And the following "categories" exist:| name | category | idnumber || Cat 1 | 0 | CAT1 |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | CAT1 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || teacher2 | C1 | editingteacher |And the following "user private file" exists:| user | teacher1 || filepath | h5p/tests/fixtures/filltheblanks.h5p |And I log in as "teacher1"Scenario: Teachers can not access system level content bankGiven I turn editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentWhen I expand "Site pages" nodeThen I should not see "Content bank"Scenario: Teachers can access course level content bankGiven I am on "Course 1" course homepage with editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentWhen I expand "Site pages" nodeThen I should see "Content bank"Scenario: Teachers can upload .h5p extension files to course content bankGiven I log outAnd I log in as "admin"And I navigate to "H5P > Manage H5P content types" in site administrationAnd I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanagerAnd I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"And I log outAnd I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentWhen I expand "Site pages" nodeAnd I click on "Content bank" "link"Then I should not see "filltheblanks.h5p"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 "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"Scenario: Other teachers can see uploaded H5P contentsGiven I log outAnd I log in as "admin"And I navigate to "H5P > Manage H5P content types" in site administrationAnd I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanagerAnd I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"And I log outAnd I log in as "teacher1"And I am on "Course 1" course homepage with editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentWhen I expand "Site pages" nodeAnd I click on "Content bank" "link"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 "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 log outWhen I log in as "teacher2"And I am on "Course 1" course homepage with 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"Then I should see "filltheblanks.h5p"Scenario: Teachers can not upload and deploy content types when libraries are not installedGiven I log outAnd I log in as "admin"And I navigate to "H5P > Manage H5P content types" in site administrationAnd I should not see "Fill in the Blanks"And I log outAnd I log in as "teacher1"And I am on "Course 1" course homepage with 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"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"Then I should see "Missing required library"And I should not see "filltheblanks.h5p"And I log outAnd I log in as "admin"And I am on "Course 1" course homepageAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I should not see "filltheblanks.h5p"Scenario: Teachers can not see existing contents when libraries are not installedGiven the following "user private file" exists:| user | admin || filepath | h5p/tests/fixtures/filltheblanks.h5p |And I log in as "admin"And I navigate to "H5P > Manage H5P content types" in site administrationAnd I should not see "Fill in the Blanks"When I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanagerAnd I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"And I wait until the page is readyAnd I should see "Fill in the Blanks"And I log outAnd I log in as "teacher1"Given I am on "Course 1" course homepage with editing mode onAnd the following config values are set as admin:| unaddableblocks | | theme_boost|And I add the "Navigation" block if not presentWhen I expand "Site pages" nodeAnd I click on "Content bank" "link"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 "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"Then I should not see "missing-main-library"And I switch to the main frameGiven I log outAnd I log in as "admin"And I navigate to "H5P > Manage H5P content types" in site administrationWhen I click on "Delete version" "link" in the "Fill in the Blanks" "table_row"And I press "Continue"Then I should not see "Fill in the Blanks"And I log outAnd I log in as "teacher1"Given I am on "Course 1" course homepageWhen I expand "Site pages" nodeAnd I click on "Content bank" "link"Then I should not see "filltheblanks.h5p"And I log outAnd I log in as "admin"And I am on "Course 1" course homepageAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I should see "filltheblanks.h5p"And I click on "filltheblanks.h5p" "link"And I switch to "h5p-player" class iframeAnd I should see "missing-main-library"