Rev 1 | AutorÃa | Comparar con el anterior | Ultima modificación | Ver Log |
@mod @mod_h5pactivity @core_h5p @_switch_iframeFeature: Inline editing H5P contentIn order to edit an existing H5P activity fileAs a teacherI need to see the button and access to the H5P editorBackground:Given the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@example.com || teacher2 | Teacher | 2 | teacher2@example.com || student1 | Student | 1 | student1@example.com |And the following "courses" exist:| fullname | shortname | category || Course 1 | C1 | 0 |And the following "course enrolments" exist:| user | course | role || teacher1 | C1 | editingteacher || teacher2 | C1 | editingteacher || student1 | C1 | student |And the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/h5p:updatelibraries | Allow | editingteacher | System | |@javascriptScenario: Add H5P activity using link to content bank fileGiven the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | teacher1 | Greeting card | /h5p/tests/fixtures/greeting-card.h5p |And I log in as "admin"# Add the navigation block.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 present# Create an H5P activity with a link to the content-bank file.And I add an h5pactivity activity to course "Course 1" section "1"And I set the following fields to these values:| Name | H5P package added as link to content bank || Description | Description |And I click on "Add..." "button" in the "Package file" "form_row"And I select "Content bank" repository in file pickerAnd I click on "Greeting card" "file" in repository content areaAnd I click on "Link to 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 iframeAnd I should see "Hello world!"And I switch to the main frame# Modify the H5P content using the edit button (which opens the H5P editor).And I follow "Edit H5P content"And I should see "This content may be in use in other places."And I switch to "h5p-editor-iframe" class iframeAnd I set the field "Greeting text" to "It's a Wonderful Life!"And I switch to the main frameAnd I click on "Save changes" "button"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframe# Check the H5P content has changed.And I should not see "Hello world!"And I should see "It's a Wonderful Life!"And I switch to the main frame# Check the H5P has also changed into the content bank.And I am on "Course 1" course homepageAnd I click on "Site pages" "list_item" in the "Navigation" "block"And I click on "Content bank" "link" in the "Navigation" "block"And I click on "Greeting card" "link"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeAnd I should not see "Hello world!"And I should see "It's a Wonderful Life!"And I switch to the main frameAnd I log out# Check teacher1 can see the Edit button (because she is the author of this file in the content bank).And I am on the "H5P package added as link to content bank" "h5pactivity activity" page logged in as teacher1And I should see "Edit H5P content"And I log out# Check teacher2 can't see the Edit button (because the file was created by the teacher1).When I am on the "H5P package added as link to content bank" "h5pactivity activity" page logged in as teacher2Then I should not see "Edit H5P content"And I log out# Check student1 can't see the Edit button.And I am on the "H5P package added as link to content bank" "h5pactivity activity" page logged in as student1And I should not see "Edit H5P content"@javascriptScenario: Add H5P activity using copy to content bank fileGiven the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | Greeting card | /h5p/tests/fixtures/greeting-card.h5p |And I log in as "admin"# Add the navigation block.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 present# Create an H5P activity with a copy to the content-bank file.And I add an h5pactivity activity to course "Course 1" section "1"And I set the following fields to these values:| Name | H5P package added as copy to content bank || Description | Description |And I click on "Add..." "button" in the "Package file" "form_row"And I select "Content bank" repository in file pickerAnd I click on "Greeting card" "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 iframeAnd I should see "Hello world!"And I switch to the main frame# Modify the H5P content using the edit button (which opens the H5P editor).And I follow "Edit H5P content"And I should not see "This content may be in use in other places."And I switch to "h5p-editor-iframe" class iframeAnd I set the field "Greeting text" to "The nightmare before Christmas"And I switch to the main frameAnd I click on "Save changes" "button"# Check the H5P content has changed.And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeAnd I should not see "Hello world!"And I should see "The nightmare before Christmas"And I switch to the main frame# Check the H5P has also changed into the content bank.And I am on "Course 1" course homepageAnd I click on "Site pages" "list_item" in the "Navigation" "block"And I click on "Content bank" "link" in the "Navigation" "block"And I click on "Greeting card" "link"And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeAnd I should see "Hello world!"And I should not see "The nightmare before Christmas"And I switch to the main frameAnd I log out# Check teacher1 can see the Edit button (because the file is a copy).And I am on the "H5P package added as copy to content bank" "h5pactivity activity" page logged in as teacher1And I should see "Edit H5P content"And I log out# Check teacher2 can also see the Edit button (because the file is a copy).When I am on the "H5P package added as copy to content bank" "h5pactivity activity" page logged in as teacher2Then I should see "Edit H5P content"And I log out# Check student1 can't see the Edit button.And I am on the "H5P package added as copy to content bank" "h5pactivity activity" page logged in as student1And I should not see "Edit H5P content"@javascriptScenario: Add H5P activity using private user fileGiven the following "user private file" exists:| user | teacher1 || filepath | h5p/tests/fixtures/greeting-card.h5p |# Create an H5P activity with a private user file.When I log in as "teacher1"And I add an h5pactivity activity to course "Course 1" section "1"And I set the following fields to these values:| Name | H5P package added as private user file || Description | Description |And I click on "Add..." "button" in the "Package file" "form_row"And I select "Private files" repository in file pickerAnd I click on "greeting-card.h5p" "file" in repository content areaAnd I click on "Link to 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 iframeAnd I should see "Hello world!"And I switch to the main frame# Modify the H5P content using the edit button (which opens the H5P editor).And I follow "Edit H5P content"And I should see "This content may be in use in other places."And I switch to "h5p-editor-iframe" class iframeAnd I set the field "Greeting text" to "Little women"And I switch to the main frameAnd I click on "Save changes" "button"# Check the H5P content has changed.And I switch to "h5p-player" class iframeAnd I switch to "h5p-iframe" class iframeAnd I should not see "Hello world!"And I should see "Little women"And I switch to the main frameAnd I log out# Check admin can't see the Edit button (because the file belongs to teacher1).And I am on the "H5P package added as private user file" "h5pactivity activity" page logged in as adminAnd I should not see "Edit H5P content"And I log out# Check teacher2 can't see the Edit button (because the file belongs to teacher1).When I am on the "H5P package added as private user file" "h5pactivity activity" page logged in as teacher2Then I should not see "Edit H5P content"And I log out# Check student1 can't see the Edit button.And I am on the "H5P package added as private user file" "h5pactivity activity" page logged in as student1And I should not see "Edit H5P content"