AutorÃa | Ultima modificación | Ver Log |
@repository @repository_contentbank @javascript @core_h5pFeature: Updating a file in the content bank after using in a courseIn order to use file aliasAs a userUpdated files must update references when is an aliasBackground:Given the following "categories" exist:| name | category | idnumber || Category1 | 0 | CAT1 |And the following "courses" exist:| fullname | shortname | category || Course1 | C1 | CAT1 |And the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | package.h5p | /h5p/tests/fixtures/guess-the-answer.h5p |Scenario: Referenced files is the default option and updates alias as wellWhen I log in as "admin"And I add an h5pactivity activity to course "Course1" section "1"And I set the following fields to these values:| Name | guessFile |And I click on "Add..." "link" in the ".fp-toolbar" "css_element"And I select "Content bank" repository in file pickerAnd I click on "package.h5p" "file" in repository content areaAnd I click on "Select this file" "button"And I click on "Save and display" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "Press here to reveal answer"And I switch to the main frame# Now edit the content in the content bank.When I am on "Course1" 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"And I click on "package.h5p" "link"And I click on "Edit" "link"And I wait until the page is readyAnd I switch to "h5p-editor-iframe" class iframeAnd I set the field "Title" to "Required title"And I set the field "Descriptive solution label" to "This is a new text"And I switch to the main frameAnd I click on "Save" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "This is a new text"And I switch to the main frame# Check the course page is updated.When I am on "Course1" course homepage with editing mode onAnd I click on "guessFile" "link" in the "page-content" "region"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "This is a new text"And I switch to the main frameScenario: Copied files should not be updated if the original is editedWhen I log in as "admin"And I add an h5pactivity activity to course "Course1" section "1"And I set the following fields to these values:| Name | guessFile |And I click on "Add..." "link" in the ".fp-toolbar" "css_element"And I select "Content bank" repository in file pickerAnd I click on "package.h5p" "file" in repository content areaAnd I click on "Make a copy of the file" "radio"And I click on "Select this file" "button"And I click on "Save and display" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "Press here to reveal answer"And I switch to the main frame# Now edit the content in the content bank.When I am on "Course1" 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"And I click on "package.h5p" "link"And I click on "Edit" "link"And I wait until the page is readyAnd I switch to "h5p-editor-iframe" class iframeAnd I set the field "Title" to "Required title"And I set the field "Descriptive solution label" to "This is a new text"And I switch to the main frameAnd I click on "Save" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "This is a new text"And I switch to the main frame# Check the course page is not updated.When I am on "Course1" course homepage with editing mode onAnd I click on "guessFile" "link" in the "page-content" "region"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeThen I should see "Press here to reveal answer"And I switch to the main frame