MDL-82527 h5p: improve editor Behat scenarios for embedding content.

* Move the shared drag fixture out of the Atto plugin;
* Switch to using faster generators for populating private files;
* Clarify required fields for private files generator
This commit is contained in:
Paul Holden 2024-07-17 13:52:24 +01:00
parent fd487cd3f2
commit 83db25c330
No known key found for this signature in database
GPG Key ID: A81A96D6045F6164
4 changed files with 36 additions and 50 deletions

View File

@ -290,7 +290,7 @@ class behat_core_generator extends behat_generator_base {
'user private files' => [
'singular' => 'user private file',
'datagenerator' => 'user_private_files',
'required' => ['user', 'filepath', 'filename'],
'required' => ['user', 'filepath'],
'switchids' => ['user' => 'userid']
],
'badge external backpacks' => [

View File

@ -1,5 +1,5 @@
@editor @editor_atto @atto @atto_h5p @core_h5p @_file_upload @_switch_iframe
Feature: Add h5ps to Atto
@editor @editor_atto @atto @atto_h5p @core_h5p @_switch_iframe
Feature: Use the Atto editor to upload an h5p package
To write rich text - I need to add h5ps.
Background:
@ -18,9 +18,6 @@ Feature: Add h5ps to Atto
And the "displayh5p" filter is "on"
And the following config values are set as admin:
| allowedsources | https://moodle.h5p.com/content/[id] | filter_displayh5p |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
@javascript @external
Scenario: Insert an embedded h5p
@ -38,11 +35,10 @@ Feature: Add h5ps to Atto
@javascript
Scenario: Insert an h5p file
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@ -97,11 +93,10 @@ Feature: Add h5ps to Atto
@javascript @external
Scenario: Edit H5P content
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/editor/atto/tests/fixtures/drag.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/drag.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
# H5P file content
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
@ -131,11 +126,10 @@ Feature: Add h5ps to Atto
@javascript
Scenario: Enable/disable H5P options atto
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
@ -207,11 +201,10 @@ Feature: Add h5ps to Atto
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
And the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
And I click on "Insert H5P" "button" in the "#fitem_id_page" "css_element"
And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue"
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"

View File

@ -1,4 +1,4 @@
@editor @editor_tiny @tiny_h5p @javascript @_file_upload
@editor @editor_tiny @tiny_h5p @javascript
Feature: Use the TinyMCE editor to upload an h5p package
In order to work with h5p
As a content creator
@ -20,9 +20,6 @@ Feature: Use the TinyMCE editor to upload an h5p package
And the "displayh5p" filter is "on"
And the following config values are set as admin:
| allowedsources | https://moodle.h5p.com/content/[id] | filter_displayh5p |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| private_files | System | 1 | my-index | side-post |
@javascript @external
Scenario: TinyMCE can be used to embed an H5P activity
@ -38,12 +35,11 @@ Feature: Use the TinyMCE editor to upload an h5p package
@javascript
Scenario: TinyMCE can be used to upload and embed an H5P activity
Given I log in as "admin"
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I change window size to "large"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the "PageName1" "page activity editing" page
And I am on the "PageName1" "page activity editing" page logged in as "admin"
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 "Private files" "link" in the ".fp-repo-area" "css_element"
@ -74,11 +70,10 @@ Feature: Use the TinyMCE editor to upload an h5p package
@javascript @external
Scenario: A user can edit H5P content embedding with TinyMCE
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "lib/editor/atto/tests/fixtures/drag.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/drag.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
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 "Private files" "link" in the ".fp-repo-area" "css_element"
@ -104,11 +99,10 @@ Feature: Use the TinyMCE editor to upload an h5p package
@javascript
Scenario: Enable/disable H5P options tiny
Given I log in as "admin"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
Given the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
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 "Private files" "link" in the ".fp-repo-area" "css_element"
@ -178,11 +172,10 @@ Feature: Use the TinyMCE editor to upload an h5p package
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I follow "Manage private files..."
And I upload "h5p/tests/fixtures/guess-the-answer.h5p" file to "Files" filemanager
And I click on "Save changes" "button"
And I am on the PageName1 "page activity editing" page
And the following "user private file" exists:
| user | admin |
| filepath | h5p/tests/fixtures/guess-the-answer.h5p |
And I am on the "PageName1" "page activity editing" page logged in as "admin"
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 "Private files" "link" in the ".fp-repo-area" "css_element"