first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,30 @@
@core @core_contentbank
Feature: Access permission to content Bank
In order to control access to content bank
As an admin
I need to be able to configure users' permissions
Background:
Given 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 |
Scenario: Admins access content bank
Given I log in as "admin"
And I am on "Course 1" course homepage
Then "Content bank" "link" should exist
Scenario: Editing teachers can access content bank at course level
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
Then "Content bank" "link" should exist
Scenario: Editing teachers can't access content bank at system level
Given I log in as "teacher1"
Then "Content bank" "link" should not exist
@@ -0,0 +1,175 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Copy content from the content bank
In order copy content from the content bank
As an admin
I need to be able to copy any content from the content bank
Background:
Given the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| System | | contenttype_h5p | admin | content2copy.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
Scenario: Admins can copy content from the content bank
Given I log in as "admin"
And I am on site homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link"
And I click on "content2copy.h5p" "link"
And I click on "More" "button"
And I click on "Copy content" "link" in the ".cb-toolbar-container" "css_element"
And I set the following fields to these values:
| Content name | |
And I click on "Save changes" "button"
Then I should see "Empty name is not allowed"
And I click on "OK" "button" in the "Error" "dialogue"
And I set the following fields to these values:
| Content name | Fill the blanks copy 1 |
And I click on "Save changes" "button"
Then I should see "Fill the blanks copy 1"
And I click on "Edit" "link"
And I switch to "h5p-editor-iframe" class iframe
Then the field "Title" matches value "Geography"
Scenario: Users without the required capability cannot copy content
Given the following "users" exist:
| username | firstname | lastname | email |
| manager | Max | Manager | man@example.com |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager | manager | System | |
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:copycontent | Prohibit | manager | System | |
| moodle/contentbank:copyanycontent | Prohibit | manager | System | |
And I log out
And I log in as "manager"
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 should see "content2copy.h5p"
And I follow "content2copy.h5p"
And I click on "More" "button"
Then I should not see "Copy content"
Scenario: Users can't copy content if they don't have the required permission
Given I log in as "admin"
And I am on site homepage
Given I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And 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" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
Given 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 the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
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 follow "filltheblanks.h5p"
And I click on "More" "button"
Then I should see "Copy content"
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:copycontent | Prohibit | editingteacher | System | |
And I reload the page
And I click on "More" "button"
Then I should not see "Copy content"
Scenario: Teachers can copy their own content in the content bank
Given I log in as "admin"
And I am on site homepage
Given I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And 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" filemanager
And 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 out
And I log in as "teacher1"
And I am on "Course 1" course homepage
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 follow "ipsums.h5p"
And I click on "More" "button"
Then I should see "Copy content"
Scenario: Teachers can't copy content created by other users in the content bank
Given 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 out
And I log in as "teacher1"
And I am on "Course 1" course homepage
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 follow "filltheblanks.h5p"
And I click on "More" "button"
Then I should not see "Copy content"
Scenario: Teachers can copy any content created by other users in the content bank if allowed
Given 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 the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:copyanycontent | Allow | editingteacher | System | |
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link"
And I follow "filltheblanks.h5p"
And I click on "More" "button"
Then I should see "Copy content"
@@ -0,0 +1,84 @@
@core @core_contentbank @core_h5p @contentbank_h5p @javascript
Feature: Delete H5P file from the content bank
In order remove H5P content from the content bank
As an admin
I need to be able to delete any H5P content from the content bank
Background:
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/filltheblanks.h5p |
And I am on the "Content bank" page logged in as "admin"
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 set the field "Save as" to "content2delete.h5p"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
Scenario: Admins can delete content from the content bank
Given I wait "2" seconds
And I click on "More" "button"
And I should see "Delete"
And I click on "Delete" "link"
And I should see "Are you sure you want to delete the content 'content2delete.h5p'"
And I should not see "The content will only be deleted from the content bank"
And I click on "Cancel" "button" in the "Delete content" "dialogue"
Then I should see "content2delete.h5p"
And I wait "2" seconds
And I click on "More" "button"
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
And I click on "Delete" "button" in the "Delete content" "dialogue"
And I wait until the page is ready
And I should see "Content deleted."
And I should not see "content2delete.h5p"
Scenario: Users without the required capability can only delete their own content
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:deleteanycontent | Prohibit | manager | System | |
And the following "users" exist:
| username | firstname | lastname | email |
| manager | Max | Manager | man@example.com |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager | manager | System | |
And the following "user private file" exists:
| user | manager |
| filepath | h5p/tests/fixtures/find-the-words.h5p |
When I am on the "Content bank" page logged in as "manager"
And I should see "content2delete.h5p"
And I follow "content2delete.h5p"
And I wait "2" seconds
And I click on "More" "button"
Then I should not see "Delete"
And I am on the "Content bank" page
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 "find-the-words.h5p" "link"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
And I wait "2" seconds
And I click on "More" "button"
And I should see "Delete"
Scenario: The number of times a content is used is displayed before removing it
Given I am on the "My private files" page
And I click on "Add..." "button"
And I select "Content bank" repository in file picker
And I click on "content2delete.h5p" "file" in repository content area
And I click on "Link to the file" "radio"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
And I am on the "Content bank" page
And I follow "content2delete.h5p"
And I wait "2" seconds
And I click on "More" "button"
And I click on "Delete" "link" in the ".cb-toolbar-container" "css_element"
Then I should see "Are you sure you want to delete the content 'content2delete.h5p'"
And I should see "The content will only be deleted from the content bank"
And I click on "Delete" "button" in the "Delete content" "dialogue"
And I should see "Content deleted."
And I should not see "content2delete.h5p"
@@ -0,0 +1,63 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Download H5P content from the content bank
In order export H5P content from the content bank
As an admin
I need to be able to download any H5P content from the content bank
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| manager | Max | Manager | man@example.com |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager | manager | System | |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| System | | contenttype_h5p | admin | filltheblanksadmin.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | manager | filltheblanksmanager.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
Scenario: Admins can download content from the content bank
Given I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
And I follow "filltheblanksmanager.h5p"
And I click on "More" "button"
And I should see "Download"
When I click on "Download" "link"
Then I should see "filltheblanksmanager.h5p"
Scenario: Users can download content created by different users
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:manageanycontent | Prohibit | manager | System | |
And I log out
And I log in as "manager"
When I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
And I should see "filltheblanksadmin.h5p"
And I follow "filltheblanksadmin.h5p"
And I click on "More" "button"
Then I should see "Download"
And I should not see "Rename"
Scenario: Users without the required capability cannot download content
Given the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:downloadcontent | Prohibit | manager | System | |
And I log out
And I log in as "manager"
When I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
And I should see "filltheblanksmanager.h5p"
And I follow "filltheblanksmanager.h5p"
And I click on "More" "button"
Then I should not see "Download"
@@ -0,0 +1,199 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Content bank use editor feature
In order to add/edit content
As a user
I need to be able to access the edition options
Background:
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And 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 creation
Given 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 disabled
Scenario: Users can see the Add button if there is content type available for creation
Given 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 permission
Given 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 iframe
And I switch to the main frame
And I click on "Cancel" "button"
And "filltheblanks.h5p" "heading" should exist
Scenario: Users can create new content if they have the required permission
Given I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And 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 iframe
And I switch to the main frame
And I click on "Cancel" "button"
Scenario: Users can't edit content if they don't have the required permission
Given 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 administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And 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 out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And 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 exist
When the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/contentbank:useeditor | Prohibit | editingteacher | System | |
And I reload the page
Then "[data-action=Add-content]" "css_element" should not exist
Scenario: Users can edit content and save changes
Given 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 iframe
And the field "Title" matches value "Geography"
And I set the field "Title" to "New title"
And I switch to the main frame
When I click on "Save" "button"
And "filltheblanks.h5p" "heading" should exist
And I click on "Edit" "link"
And I switch to "h5p-editor-iframe" class iframe
Then the field "Title" matches value "New title"
Scenario: Teachers can edit their own content in the content bank
Given I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And 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" filemanager
And 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 out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And 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 bank
Given 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 out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And 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 courses
Given 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" page
And 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 cron
And I am on homepage
And I log out
And I log in as "teacher1"
And I am on "Copy" course homepage
And I expand "Site pages" node
And 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 administration
And I follow "filltheblanks.h5p"
Then "Edit" "link" should not exist in the "region-main" "region"
+75
View File
@@ -0,0 +1,75 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_switch_iframe @javascript
Feature: Confirm content bank events are triggered
In order to log content bank actions
As an admin
I need to be able to check triggered events
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | admin | Existing | /h5p/tests/fixtures/filltheblanks.h5p |
And the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/filltheblanks.h5p |
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add the "Navigation" block if not present
Scenario: Content created and uploaded events when uploading a content file
Given I navigate to "Reports > Live logs" in site administration
And I should not see "Content uploaded"
And I should not see "Content created"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And 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"
And I navigate to "Reports > Live logs" in site administration
Then I should see "Content uploaded"
And I should see "Content created"
Scenario: Content viewed event
Given I navigate to "Reports > Live logs" in site administration
And I should not see "Content viewed"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And I click on "Content bank" "link"
When I click on "Existing" "link"
And I navigate to "Reports > Live logs" in site administration
Then I should see "Content viewed"
Scenario: Content deleted event
Given I navigate to "Reports > Live logs" in site administration
And I should not see "Content deleted"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And I click on "Content bank" "link"
And I click on "Existing" "link"
And I click on "More" "button"
When I click on "Delete" "link"
And I click on "Delete" "button" in the "Delete content" "dialogue"
And I navigate to "Reports > Live logs" in site administration
Then I should see "Content deleted"
Scenario: Content updated event when renaming
Given I navigate to "Reports > Live logs" in site administration
And I should not see "Content updated"
And I am on "Course 1" course homepage
And I expand "Site pages" node
And I click on "Content bank" "link"
And I click on "Existing" "link"
And I click on "More" "button"
When I click on "Rename" "link"
And I set the field "Content name" to "New name"
And I click on "Rename" "button"
And I navigate to "Reports > Live logs" in site administration
Then I should see "Content updated"
@@ -0,0 +1,101 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Navigate to different contexts in the content bank
In order to navigate easily in the content bank
I need to be able to view dropdown with all allowed contexts in the content bank
Background:
Given I log in as "admin"
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
| Cat 2 | 0 | CAT2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 0 | C0 | |
| Course 1 | C1 | CAT1 |
| Course 2 | C2 | CAT2 |
And I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| System | | contenttype_h5p | admin | santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Category | CAT1 | contenttype_h5p | admin | santjordi_rose.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Category | CAT2 | contenttype_h5p | admin | SantJordi_book | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | C0 | contenttype_h5p | admin | Dragon.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | C1 | contenttype_h5p | admin | princess.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | C2 | contenttype_h5p | admin | mathsbook.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
Scenario: Admins can view and navigate to all the contexts in the content bank
Given I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
When I click on "Content bank" "link"
And the "Choose course or category" select box should contain "System"
And the "Choose course or category" select box should contain "Cat 1"
And the "Choose course or category" select box should contain "Cat 2"
And the "Choose course or category" select box should contain "Course 0"
And the "Choose course or category" select box should contain "Course 1"
And the "Choose course or category" select box should contain "Course 2"
And I should see "santjordi.h5p"
And I should not see "santjordi_rose.h5p"
And I should not see "Dragon.h5p"
And I set the field "Choose course or category" to "Cat 1"
Then I should not see "santjordi.h5p"
And I should see "santjordi_rose.h5p"
And I should not see "Dragon.h5p"
And I set the field "Choose course or category" to "Course 0"
And I should not see "santjordi.h5p"
And I should not see "santjordi_rose.h5p"
And I should see "Dragon.h5p"
Scenario: Teachers can view and navigate to contexts in the content bank based on their permissions
Given the following "users" exist:
| username | firstname | lastname |
| teacher | Joseba | Cilarte |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C0 | editingteacher |
| teacher | C1 | editingteacher |
And I log out
And I am on the "C0" "Course" page logged in as "teacher"
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
When I click on "Content bank" "link"
And the "Choose course or category" select box should contain "Course 0"
And the "Choose course or category" select box should contain "Course 1"
And the "Choose course or category" select box should not contain "System"
And the "Choose course or category" select box should not contain "Cat 1"
And the "Choose course or category" select box should not contain "Cat 2"
And the "Choose course or category" select box should not contain "Course 2"
And I should see "Dragon.h5p"
And I should not see "princess.h5p"
And I should not see "santjordi.h5p"
And I should not see "santjordi_rose.h5p"
And I set the field "Choose course or category" to "Course 1"
Then I should not see "Dragon.h5p"
And I should see "princess.h5p"
And I should not see "santjordi.h5p"
And I should not see "santjordi_rose.h5p"
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| teacher | manager | Category | CAT1 |
And I am on the "C0" "Course" page logged in as "teacher"
And I expand "Site pages" node
When I click on "Content bank" "link"
And the "Choose course or category" select box should contain "Course 0"
And the "Choose course or category" select box should contain "Course 1"
And the "Choose course or category" select box should contain "Cat 1"
And the "Choose course or category" select box should not contain "System"
And the "Choose course or category" select box should not contain "Cat 2"
And the "Choose course or category" select box should not contain "Course 2"
And I should see "Dragon.h5p"
And I set the field "Choose course or category" to "Cat 1"
And I should not see "Dragon.h5p"
And I should see "santjordi_rose.h5p"
@@ -0,0 +1,62 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Search content in the content bank
In order to find easily content in the content bank
As an admin
I need to be able to search content in the content bank
Background:
Given I log in as "admin"
And I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| System | | contenttype_h5p | admin | santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | santjordi_rose.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | SantJordi_book | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | Dragon_santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | princess.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | mathsbook.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | historybook.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | santvicenc.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
Scenario: Admins can search content in the content bank
Given I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
And I should see "santjordi.h5p"
And "Clear search input" "button" should not be visible
And I should not see "items found"
When I set the field "Search" to "book"
# Waiting for the animation to show the button to finish.
And I wait "1" seconds
Then "Clear search input" "button" should be visible
And I should see "3 items found"
And I should see "SantJordi_book"
And I should see "mathsbook.h5p"
And I should see "historybook.h5p"
And I set the field "Search" to "sant"
And "Clear search input" "button" should be visible
And I should see "5 items found"
And I set the field "Search" to "santjordi"
And I should see "4 items found"
And I should see "santjordi.h5p"
And I should see "santjordi_rose.h5p"
And I should see "SantJordi_book"
And I should see "Dragon_santjordi.h5p"
And I click on "Clear search input" "button"
# Waiting for the animation to hide the button to finish.
And I wait "1" seconds
And "Clear search input" "button" should not be visible
And I should not see "items found"
And I set the field "Search" to ".h5p"
# Waiting for the animation to show the button to finish.
And I wait "1" seconds
And "Clear search input" "button" should be visible
And I should see "7 items found"
And I set the field "Search" to "friend"
And I should see "0 items found"
@@ -0,0 +1,59 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Sort content in the content bank
In order to temporarily organise the content of the content bank
As an admin
I need to be able to sort the content bank in various ways
Background:
Given I log in as "admin"
And I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And the following "users" exist:
| username | firstname | lastname | email |
| manager | Max | Manager | man@example.com |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| manager | manager | System | |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| System | | contenttype_h5p | admin | Dragon_santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | mathsbook.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | manager | historybook.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | santjordi.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | santjordi_rose.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| System | | contenttype_h5p | admin | SantJordi_book | /h5p/tests/fixtures/filltheblanks.h5p |
Scenario: Admins can order content in the content bank
Given I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
When I click on "Display content bank with file details" "button"
And I click on "Sort by Content name ascending" "button"
And "Dragon_santjordi.h5p" "text" should appear before "historybook.h5p" "text"
And "historybook.h5p" "text" should appear before "mathsbook.h5p" "text"
And "SantJordi_book" "text" should appear before "santjordi_rose.h5p" "text"
And I click on "Sort by Content name descending" "button"
And "historybook.h5p" "text" should appear before "Dragon_santjordi.h5p" "text"
And "mathsbook.h5p" "text" should appear before "historybook.h5p" "text"
Then "santjordi_rose.h5p" "text" should appear before "SantJordi_book" "text"
Scenario: Admins can order content depending on the author
Given I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I expand "Site pages" node
And I click on "Content bank" "link"
When I click on "Display content bank with file details" "button"
Then I click on "Sort by Author ascending" "button"
And "Dragon_santjordi.h5p" "text" should appear before "historybook.h5p" "text"
And "santjordi_rose.h5p" "text" should appear before "historybook" "text"
And I click on "Sort by Author descending" "button"
And "historybook.h5p" "text" should appear before "Dragon_santjordi.h5p" "text"
And "historybook.h5p" "text" should appear before "santjordi_rose" "text"
@@ -0,0 +1,67 @@
@core @core_contentbank @core_h5p @contentbank_h5p @javascript
Feature: Store the content bank view preference
In order to consistantly view the content bank in icons or details view
As an admin
I need to be able to store my view preference
Background:
Given the following "user private files" exist:
| user | filepath |
| admin | h5p/tests/fixtures/filltheblanks.h5p |
| admin | h5p/tests/fixtures/greeting-card.h5p |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I expand "Site pages" node
And 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 set the field "Save as" to "fib.h5p"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
And 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 "greeting-card.h5p" "link"
And I set the field "Save as" to "greetingcard.h5p"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
Scenario: There are several views for displaying contents into the content bank
Given I am on site homepage
And I expand "Site pages" node
And I click on "Content bank" "link"
When I click on "Display content bank with file details" "button"
Then I should see "Last modified"
And I follow "greetingcard.h5p"
And I click on "Content bank" "link"
And I should see "Last modified"
And I click on "Display content bank with icons" "button"
And I follow "greetingcard.h5p"
And I click on "Content bank" "link"
And I should not see "Last modified"
Scenario: Display the number of times a content is used in file details view
Given I am on the "My private files" page
And I click on "Add..." "button"
And I select "Content bank" repository in file picker
And I click on "fib.h5p" "file" in repository content area
And I click on "Link to the file" "radio"
And I click on "Select this file" "button"
And I click on "Save changes" "button"
When I am on site homepage
And I expand "Site pages" node
And I click on "Content bank" "link"
And I click on "Display content bank with file details" "button"
Then I should see "1" in the "[data-file='fib.h5p'] .cb-uses" "css_element"
And I should see "0" in the "[data-file='greetingcard.h5p'] .cb-uses" "css_element"
+153
View File
@@ -0,0 +1,153 @@
@core @core_contentbank @core_h5p @contentbank_h5p @_file_upload @javascript
Feature: Make content public or unlisted
In order to make content public or unlisted
As a user
I need to be able to access the edition options
Background:
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I navigate to "H5P > Manage H5P content types" in site administration
And I upload "h5p/tests/fixtures/filltheblanks.h5p" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
Scenario: Users can make their content public or unlisted
Given the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath | visibility |
| System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | 1 |
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 wait until the page is ready
And "filltheblanks.h5p (Unlisted)" "heading" should not exist
And I click on "More" "button"
And I should see "Make unlisted"
And I click on "Make unlisted" "link"
And I wait until the page is ready
Then "filltheblanks.h5p (Unlisted)" "heading" should exist
And I click on "More" "button"
And I should see "Make public"
Scenario: Unlisted content cannot be seen by other users
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher2 | Teacher | 2 | teacher2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath | visibility |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | 2 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
Then I should see "filltheblanks.h5p (Unlisted)"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
Then I should not see "filltheblanks.h5p"
Scenario: Unlisted content is not found through search by other users
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher2 | Teacher | 2 | teacher2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath | visibility |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | 2 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
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 set the field "Search" to "filltheblanks.h5p"
And I should see "filltheblanks.h5p"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Content bank" "link" in the "Navigation" "block"
When I set the field "Search" to "filltheblanks.h5p"
Then I should not see "filltheblanks.h5p"
Scenario: Managers can see other users' unlisted content
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| manager1 | Manager | 1 | manager1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| manager1 | C1 | manager |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath | visibility |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | 2 |
And I log out
And I log in as "manager1"
And I am on "Course 1" course homepage
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 should see "filltheblanks.h5p (Unlisted)"
And I set the field "Search" to "filltheblanks.h5p"
And I should see "filltheblanks.h5p (Unlisted)"
@_file_upload
Scenario: Default content visibility can be set to unlisted
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And I set the following administration settings values:
| Default content visibility | 2 |
And I am on "Course 1" course homepage
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 upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
And I click on "Save changes" "button"
Then "filltheblanks.h5p (Unlisted)" "heading" should exist
@_file_upload
Scenario: User preference concerning content visibility overrides site-wide default content visibility
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And I set the following administration settings values:
| Default content visibility | 2 |
And the following "user preferences" exist:
| user | preference | value |
| admin | core_contentbank_visibility | 1 |
And I am on "Course 1" course homepage
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 upload "h5p/tests/fixtures/filltheblanks.h5p" file to "Upload content" filemanager
And I click on "Save changes" "button"
Then "filltheblanks.h5p" "heading" should exist
And "filltheblanks.h5p (Unlisted)" "heading" should not exist