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
+64
View File
@@ -0,0 +1,64 @@
@core_h5p @_file_upload @_switch_iframe @editor_tiny
Feature: Undeployed H5P content should be only available to users that can deploy packages.
Background:
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 |
# Make sure that the teacher2 can update libraries so it show the right info when.
And the following "permission overrides" exist:
| capability | permission | role | contextlevel | reference |
| moodle/h5p:updatelibraries | Allow | editingteacher | System | |
And the following "activities" exist:
| activity | name | intro | introformat | course | content | contentformat | idnumber |
| page | H5PPage | PageDesc1 | 1 | C1 | H5Ptest | 1 | 1 |
And I am on the H5PPage "page activity editing" page logged in as teacher1
And the following "contentbank content" exist:
| contextlevel | reference | contenttype | user | contentname | filepath |
| Course | C1 | contenttype_h5p | teacher1 | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p |
And I click on the "Configure H5P content" button for the "Page content" TinyMCE editor
And I click on "Browse repositories..." "button" in the "Insert H5P content" "dialogue"
And I click on "Content bank" "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 "Insert H5P content" "button" in the "Insert H5P content" "dialogue"
# This is important here not to do Save and display as if not this will be deployed and the student will see it in the first step.
And I click on "Save and return to course" "button"
And I log out
And I log in as "admin"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I press "Delete" action in the "Teacher 1" report row
And I click on "Delete" "button" in the "Delete user" "dialogue"
And I should see "Deleted user Teacher 1"
@javascript
Scenario: A student I should not be able to see a package that has been deployed by a deleted user. Then if another user deploys the package, I can see it.
Given I am on the "H5PPage" "page activity" page logged in as student1
And I switch to "h5p-iframe" class iframe
And I should see "This file can't be displayed"
And I switch to the main frame
And I log out
# Then teacher2 will be allowed to deploy the package.
When I am on the "H5PPage" "page activity" page logged in as teacher2
# Note the double switch to iframe is needed because the first iframe is the one that contains the H5P package and
# the second iframe is the one that contains the H5P content.
And I switch to "h5p-iframe" class iframe
And I switch to "h5p-iframe" class iframe
Then I should see "Of which countries are Berlin"
And I switch to the main frame
And I log out
# Now student1 should be able to see the package.
And I am on the "H5PPage" "page activity" page logged in as student1
And I switch to "h5p-iframe" class iframe
And I switch to "h5p-iframe" class iframe
And I should see "Of which countries are Berlin"
+76
View File
@@ -0,0 +1,76 @@
@editor @core_h5p @_file_upload
Feature: Upload and list H5P libraries and content types installed
@javascript
Scenario: No library installed in new installations.
Given I log in as "admin"
When I navigate to "H5P > Manage H5P content types" in site administration
Then I should see "Upload H5P content types"
And I should not see "Installed H5P"
@javascript
Scenario: Upload an invalid content type.
Given I log in as "admin"
And I navigate to "H5P > Manage H5P content types" in site administration
When I upload "h5p/tests/fixtures/h5ptest.zip" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And I wait until the page is ready
Then I should see "Invalid H5P content type"
And I should not see "Installed H5P"
@javascript
Scenario: Upload a valid content type.
Given I log in as "admin"
And I navigate to "H5P > Manage H5P content types" in site administration
When 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 wait until the page is ready
Then I should see "H5P content types uploaded successfully"
And I should see "Installed H5P"
And I should see "Installed H5P content types"
And I should see "Fill in the Blanks"
And I should not see "Essay"
And I should see "Installed H5P libraries"
And I click on "Installed H5P libraries" "link"
And I should see "Question"
And I should see "1.4" in the "Question" "table_row"
And I should not see "1.3" in the "Question" "table_row"
And I upload "h5p/tests/fixtures/essay.zip" file to "H5P content type" filemanager
And I click on "Upload H5P content types" "button" in the "#fitem_id_uploadlibraries" "css_element"
And I wait until the page is ready
# Existing content types are kept and new added
And I should see "Fill in the Blanks"
And I should see "Essay"
And I click on "Installed H5P libraries" "link"
And I should see "1.3" in the "Question" "table_row"
And I should see "1.4"
@javascript
Scenario: Delete H5P library.
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 I wait until the page is ready
And I click on "Installed H5P libraries" "link"
When I click on "Delete version" "link" in the "H5P.FontIcons" "table_row"
And I press "Continue"
And I click on "Installed H5P content types" "link"
Then I should not see "Fill in the Blanks"
And I click on "Installed H5P libraries" "link"
And I should not see "H5P.FontIcons"
And I should not see "Joubel UI"
And I should see "Transition"
@javascript
Scenario: Enable/disable H5P library
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"
When I click on "Disable" "link" in the "Fill in the Blanks" "table_row"
Then "Enable" "icon" should exist in the "Fill in the Blanks" "table_row"
And "Disable" "icon" should not exist in the "Fill in the Blanks" "table_row"
And I click on "Enable" "link" in the "Fill in the Blanks" "table_row"
And "Disable" "icon" should exist in the "Fill in the Blanks" "table_row"
And "Enable" "icon" should not exist in the "Fill in the Blanks" "table_row"
+34
View File
@@ -0,0 +1,34 @@
@editor @core_h5p
Feature: Check H5P tools information is correct
@javascript
Scenario: Display H5P filter information.
Given I log in as "admin"
When I navigate to "H5P > H5P overview" in site administration
Then I should see "Enable" in the "Display H5P filter" "table_row"
And I click on "Display H5P filter" "link"
And I set the field "newstate" in the "Display H5P" "table_row" to "Off, but available"
And I navigate to "H5P > H5P overview" in site administration
And I should see "Off, but available" in the "Display H5P filter" "table_row"
@javascript
Scenario: 'Download available H5P content types from h5p.org' scheduled task.
Given I log in as "admin"
When I navigate to "H5P > H5P overview" in site administration
Then I should see "Enable" in the "H5P scheduled task" "table_row"
And I click on "H5P scheduled task" "link"
And I set the field "disabled" to "1"
And I click on "Save changes" "button"
And I navigate to "H5P > H5P overview" in site administration
And I should see "Disable" in the "H5P scheduled task" "table_row"
@javascript
Scenario: H5P editor button.
Given I log in as "admin"
When I navigate to "H5P > H5P overview" in site administration
Then I should see "Enable" in the "Insert H5P button" "table_row"
And I click on "Insert H5P button" "link"
And I set the field "Toolbar config" to "style1 = title, bold, italic"
And I click on "Save changes" "button"
When I navigate to "H5P > H5P overview" in site administration
Then I should see "Disable" in the "Insert H5P button" "table_row"