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,99 @@
@repository @repository_contentbank @javascript @core_h5p
Feature: Updating a file in the content bank after using in a course
In order to use file alias
As a user
Updated files must update references when is an alias
Background:
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 well
When 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 picker
And I click on "package.h5p" "file" in repository content area
And I click on "Select this file" "button"
And I click on "Save and display" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then 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 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 click on "package.h5p" "link"
And I click on "Edit" "link"
And I wait until the page is ready
And I switch to "h5p-editor-iframe" class iframe
And 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 frame
And I click on "Save" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then 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 on
And I click on "guessFile" "link" in the "page-content" "region"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "This is a new text"
And I switch to the main frame
Scenario: Copied files should not be updated if the original is edited
When 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 picker
And I click on "package.h5p" "file" in repository content area
And 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 iframe
And I switch to "h5p-iframe" class iframe
Then 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 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 click on "package.h5p" "link"
And I click on "Edit" "link"
And I wait until the page is ready
And I switch to "h5p-editor-iframe" class iframe
And 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 frame
And I click on "Save" "button"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then 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 on
And I click on "guessFile" "link" in the "page-content" "region"
And I switch to "h5p-player" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "Press here to reveal answer"
And I switch to the main frame
@@ -0,0 +1,109 @@
@repository @repository_contentbank @javascript
Feature: Search content bank files using the content bank files repository
In order to find the content I need to select in the file picker
As a user
I need to be able to search in the content bank files repository by content name
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student | Student | 1 | student@example.com |
| teacher | Teacher | 1 | teacher1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Category1 | 0 | CAT1 |
| Category2 | 0 | CAT2 |
And the following "courses" exist:
| fullname | shortname | category |
| Course1 | C1 | CAT1 |
| Course2 | C2 | CAT2 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | admin | coursecontent1.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | C2 | contenttype_h5p | admin | coursecontent2.h5p | /h5p/tests/fixtures/find-the-words.h5p |
| Category | CAT1 | contenttype_h5p | admin | categorycontent1.h5p | /h5p/tests/fixtures/ipsums.h5p |
| Category | CAT2 | contenttype_h5p | admin | categorycontent2.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p |
| System | | contenttype_h5p | admin | systemcontent.h5p | /h5p/tests/fixtures/greeting-card.h5p |
And the following "activities" exist:
| activity | name | intro | introformat | course | idnumber |
| folder | Folder | FolderDesc | 1 | C1 | folder |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C1 | editingteacher |
Scenario: User can see a search field and reset search button in the content bank files repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then "Search repository" "field" should be visible
And "Refresh" "link" should be visible
Scenario: User can see search results when there is content that matches the search criteria
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "content"
When I press enter
Then I should see "5" elements in repository content area
And I should see "systemcontent.h5p" "file" in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "categorycontent2.h5p" "file" in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "coursecontent2.h5p" "file" in repository content area
Scenario: User can see search results when there is content that matches the search criteria ignoring case sensitivity
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "COURSE"
When I press enter
Then I should see "2" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "coursecontent2.h5p" "file" in repository content area
Scenario: User can not see any search results when there is not a content that matches the search criteria
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "somecontent"
When I press enter
Then I should see "0" elements in repository content area
And I should see "No files available" in the ".filepicker .fp-content" "css_element"
Scenario: User can reset search criteria and see all content displayed prior the search action
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "1" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I set the field "Search repository" to "category"
And I press enter
And I should see "2" elements in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "categorycontent2.h5p" "file" in repository content area
When I click on "Refresh" "link"
Then I should see "1" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
Scenario: Editing teacher can see search results when the content is available to him and matches the search criteria
Given I am on the Folder "Folder activity" page logged in as teacher
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I set the field "Search repository" to "content"
When I press enter
Then I should see "3" elements in repository content area
And I should see "coursecontent1.h5p" "file" in repository content area
And I should see "categorycontent1.h5p" "file" in repository content area
And I should see "systemcontent.h5p" "file" in repository content area
@@ -0,0 +1,157 @@
@repository @repository_contentbank @javascript
Feature: Select content bank files using the content bank files repository
In order to re-use content bank files
As a user
I need to be able to view and select content bank files using the content bank repository
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student | Student | 1 | student@example.com |
| teacher1 | Teacher 1 | 1 | teacher1@example.com |
| teacher2 | Teacher 2 | 1 | teacher2@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Category1 | 0 | CAT1 |
| SubCategory1 | CAT1 | SUBCAT1 |
And the following "courses" exist:
| fullname | shortname | category |
| MiscellaneousCourse1 | mscC1 | 0 |
| MiscellaneousCourse2 | mscC2 | 0 |
| Category1Course1 | cat1C1 | CAT1 |
| SubCategory1Course1 | subcat1C1 | SUBCAT1 |
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | mscC1 | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
| Course | mscC2 | contenttype_h5p | admin | find-the-words.h5p | /h5p/tests/fixtures/find-the-words.h5p |
| Course | subcat1C1 | contenttype_h5p | admin | greeting-card.h5p | /h5p/tests/fixtures/greeting-card.h5p |
| Category | CAT1 | contenttype_h5p | admin | ipsums.h5p | /h5p/tests/fixtures/ipsums.h5p |
| Category | SUBCAT1 | contenttype_h5p | admin | multiple-choice-2-6.h5p | /h5p/tests/fixtures/multiple-choice-2-6.h5p |
| System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And the following "activities" exist:
| activity | name | intro | introformat | course | idnumber |
| forum | Forum | | 1 | mscC1 | forum1 |
| folder | Folder | FolderDesc | 1 | mscC1 | folder1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | mscC1 | editingteacher |
| teacher2 | mscC1 | teacher |
| student | mscC1 | student |
Scenario: Admin can navigate and see all existing content bank files using the content bank repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System > Category 1" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "MiscellaneousCourse1" "folder" in repository content area
And I should see "MiscellaneousCourse2" "folder" in repository content area
And I click on "MiscellaneousCourse2" "folder" in repository content area
And I should see "System > Category 1 > MiscellaneousCourse2" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "find-the-words.h5p" "file" in repository content area
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System" breadcrumb navigation in repository
And I should see "3" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I should see "Category 1" "folder" in repository content area
And I should see "Category1" "folder" in repository content area
And I click on "Category1" "folder" in repository content area
And I should see "System > Category1" breadcrumb navigation in repository
And I should see "3" elements in repository content area
And I should see "SubCategory1" "folder" in repository content area
And I should see "Category1Course1" "folder" in repository content area
And I should see "ipsums.h5p" "file" in repository content area
And I click on "SubCategory1" "folder" in repository content area
And I should see "System > Category1 > SubCategory1" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "SubCategory1Course1" "folder" in repository content area
And I should see "multiple-choice-2-6.h5p" "file" in repository content area
And I click on "SubCategory1Course1" "folder" in repository content area
And I should see "System > Category1 > SubCategory1 > SubCategory1Course1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "greeting-card.h5p" "file" in repository content area
Scenario: Admin can select and re-use content bank files using the content bank repository
Given I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I click on "Category1" "folder" in repository content area
And I should see "ipsums.h5p" "file" in repository content area
And I click on "ipsums.h5p" "file" in repository content area
And I should see "Select ipsums.h5p"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "ipsums.h5p" in the ".fp-content .fp-file" "css_element"
Scenario: Editing teacher can navigate and see content bank files available to him using the content bank repository
Given I am on the Folder "Folder activity" page logged in as teacher1
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "Category 1" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System > Category 1" breadcrumb navigation in repository
And I should see "1" elements in repository content area
And I should see "MiscellaneousCourse1" "folder" in repository content area
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "System" breadcrumb navigation in repository
And I should see "2" elements in repository content area
And I should see "filltheblanks.h5p" "file" in repository content area
And I should see "Category 1" "folder" in repository content area
Scenario: Editing teacher can select and re-use content bank files available to him using the content bank repository
Given I am on the Folder "Folder activity" page logged in as teacher1
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
And I select "Content bank" repository in file picker
And I should see "System > Category 1 > MiscellaneousCourse1" breadcrumb navigation in repository
And I click on "System" "link" in the ".file-picker .fp-pathbar" "css_element"
And I should see "filltheblanks.h5p" "file" in repository content area
And I click on "filltheblanks.h5p" "file" in repository content area
And I should see "Select filltheblanks.h5p"
When I click on "Select this file" "button"
Then I should see "1" elements in "Files" filemanager
And I should see "filltheblanks.h5p" in the ".fp-content .fp-file" "css_element"
Scenario: Non-editing teacher can not see the content bank repository
Given I am on the Forum "Forum activity" page logged in as teacher2
And I click on "Add discussion topic" "link"
And I click on "Advanced" "button"
When I click on "Add..." "button"
Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
Scenario: Student can not see the content bank repository
Given I am on the Forum "Forum activity" page logged in as student
And I click on "Add discussion topic" "link"
And I click on "Advanced" "button"
When I click on "Add..." "button"
Then I should not see "Content bank" in the ".fp-repo-area" "css_element"
Scenario: Both content name and file name are shown when a content is selected
Given the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | mscC1 | contenttype_h5p | admin | My content | /h5p/tests/fixtures/ipsums.h5p |
And I am on the Folder "Folder activity" page logged in as admin
And I click on "Edit" "button"
And I click on "Add..." "button"
And I should see "Content bank" in the ".fp-repo-area" "css_element"
When I select "Content bank" repository in file picker
Then I should see "My content"
And I click on "My content" "link"
And I should see "Select My content"
And the field "Save as" matches value "ipsums.h5p"