Rev 1 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascriptFeature: Content bank use editor featureIn order to add/edit contentAs a userI need to be able to access the edition optionsBackground:Given I log in as "admin"And I am on site homepageAnd 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 configure the "Navigation" blockAnd I set the following fields to these values:| Page contexts | Display throughout the entire site |And I press "Save changes"Scenario: Users see the Add button disabled if there is no content type available for creationGiven I click on "Site pages" "list_item" in the "Navigation" "block"When I click on "Content bank" "link"Then the "[data-action=Add-content]" "css_element" should be disabledScenario: Users can see the Add button if there is content type available for creationGiven the following "user private file" exists:| user | admin || filepath | h5p/tests/fixtures/filltheblanks.h5p |And 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 "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"When I click on "Content bank" "link"And I click on "filltheblanks.h5p" "link"And I click on "Exit" "link"Then I click on "[data-action=Add-content]" "css_element"And I should see "Fill in the Blanks"Scenario: Users can edit content if they have the required permissionGiven the following "user private file" exists:| user | admin || filepath | h5p/tests/fixtures/filltheblanks.h5p |And 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 "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"When I click on "Content bank" "link"And I click on "filltheblanks.h5p" "link"Then I click on "Edit" "link"And I switch to "h5p-editor-iframe" class iframeAnd I switch to the main frameAnd I click on "Cancel" "button"And "filltheblanks.h5p" "heading" should existScenario: Users can create new content if they have the required permissionGiven 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 should see "H5P content types uploaded successfully"And I click on "Site pages" "list_item" in the "Navigation" "block"When I click on "Content bank" "link" in the "Navigation" "block"And I click on "[data-action=Add-content]" "css_element"Then I click on "Fill in the Blanks" "link"And I switch to "h5p-editor-iframe" class iframeAnd I switch to the main frameAnd I click on "Cancel" "button"Scenario: Users can't edit content if they don't have the required permissionGiven the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | user1@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 |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 should see "H5P content types uploaded successfully"And I log outAnd I log in as "teacher1"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"And "[data-action=Add-content]" "css_element" should existWhen the following "permission overrides" exist:| capability | permission | role | contextlevel | reference || moodle/contentbank:useeditor | Prohibit | editingteacher | System | |And I reload the pageThen "[data-action=Add-content]" "css_element" should not existScenario: Users can edit content and save changesGiven the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |And 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 "filltheblanks.h5p" "link"And I click on "Edit" "link"And I switch to "h5p-editor-iframe" class iframeAnd the field "Title" matches value "Geography"And I set the field "Title" to "New title"And I switch to the main frameWhen I click on "Save" "button"And "filltheblanks.h5p" "heading" should existAnd I click on "Edit" "link"And I switch to "h5p-editor-iframe" class iframeThen the field "Title" matches value "New title"Scenario: Teachers can edit their own content in the content bankGiven 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 upload "h5p/tests/fixtures/ipsums.h5p" file to "H5P content type" filemanagerAnd I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"And the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@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 |And the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p || Course | C1 | contenttype_h5p | teacher1 | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p |When I log outAnd I log in as "teacher1"And I am on "Course 1" course homepageAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I follow "ipsums.h5p"Then "Edit" "link" should exist in the "region-main" "region"Scenario: Teachers can't edit content created by other users in the content bankGiven the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@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 |And the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p || Course | C1 | contenttype_h5p | teacher1 | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p |When I log outAnd I log in as "teacher1"And I am on "Course 1" course homepageAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I follow "filltheblanks.h5p"Then "Edit" "link" should not exist in the "region-main" "region"Scenario: Teachers keep their content authoring in copied coursesGiven the following "users" exist:| username | firstname | lastname | email || teacher1 | Teacher | 1 | teacher1@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 |And the following "contentbank content" exist:| contextlevel | reference | contenttype | user | contentname | filepath || Course | C1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p || Course | C1 | contenttype_h5p | teacher1 | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p |And I am on the "Course 1" "course copy" pageAnd I set the following fields to these values:| Course full name | Copy || Course short name | Copy || Teacher | 1 |When I press "Copy and view"And I trigger cronAnd I am on homepageAnd I log outAnd I log in as "teacher1"And I am on "Copy" course homepageAnd I expand "Site pages" nodeAnd I click on "Content bank" "link"And I follow "ipsums.h5p"Then "Edit" "link" should exist in the "region-main" "region"And I navigate to "Content bank" in current page administrationAnd I follow "filltheblanks.h5p"Then "Edit" "link" should not exist in the "region-main" "region"