From 32a85859bf8d9960036f99cf7c751fb4a8f2bfc0 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 25 Jul 2024 19:58:37 +0100 Subject: [PATCH] MDL-82596 behat: tidy up existing usage of private files generator. Filename is no longer required (since 83db25c330), given it never did anything so can be removed. Requiring the "Private files" block also isn't necessary since original switch to generator methods. --- .../field/textarea/tests/behat/default_value.feature | 7 ++----- customfield/tests/behat/edit_fields_settings.feature | 7 ++----- filter/displayh5p/tests/behat/h5p_filter.feature | 3 --- mod/lesson/tests/behat/duplicate_lesson_page.feature | 7 ++----- mod/lesson/tests/behat/questions_images.feature | 7 ++----- mod/quiz/tests/behat/manually_mark_question.feature | 7 ++----- mod/workshop/tests/behat/embedded_images.feature | 7 ++----- 7 files changed, 12 insertions(+), 33 deletions(-) diff --git a/customfield/field/textarea/tests/behat/default_value.feature b/customfield/field/textarea/tests/behat/default_value.feature index ee49d2a14a6..aa757d5f743 100644 --- a/customfield/field/textarea/tests/behat/default_value.feature +++ b/customfield/field/textarea/tests/behat/default_value.feature @@ -21,12 +21,9 @@ Feature: Default value for the textarea custom field can contain images And the following "custom field categories" exist: | name | component | area | itemid | | Category for test | core_course | course | 0 | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "user private files" exist: - | user | filepath | filename | - | admin | lib/tests/fixtures/gd-logo.png | gd-logo.png | + | user | filepath | + | admin | lib/tests/fixtures/gd-logo.png | And I log in as "admin" And I navigate to "Courses > Course custom fields" in site administration And I click on "Add a new custom field" "link" diff --git a/customfield/tests/behat/edit_fields_settings.feature b/customfield/tests/behat/edit_fields_settings.feature index 155859393ac..4bf96ed5cf7 100644 --- a/customfield/tests/behat/edit_fields_settings.feature +++ b/customfield/tests/behat/edit_fields_settings.feature @@ -25,12 +25,9 @@ Feature: Teachers can edit course custom fields And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "user private files" exist: - | user | filepath | filename | - | admin | lib/tests/fixtures/gd-logo.png | gd-logo.png | + | user | filepath | + | admin | lib/tests/fixtures/gd-logo.png | Scenario: Display custom fields on course edit form When I log in as "teacher1" diff --git a/filter/displayh5p/tests/behat/h5p_filter.feature b/filter/displayh5p/tests/behat/h5p_filter.feature index f0ab95bec5f..93ece199a7d 100644 --- a/filter/displayh5p/tests/behat/h5p_filter.feature +++ b/filter/displayh5p/tests/behat/h5p_filter.feature @@ -14,9 +14,6 @@ Feature: Render H5P content using filters | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the "displayh5p" filter is "on" And the following config values are set as admin: | allowedsources | https://moodle.h5p.com/content/[id]/embed | filter_displayh5p | diff --git a/mod/lesson/tests/behat/duplicate_lesson_page.feature b/mod/lesson/tests/behat/duplicate_lesson_page.feature index 0c646fc1c62..61fc0d3c939 100644 --- a/mod/lesson/tests/behat/duplicate_lesson_page.feature +++ b/mod/lesson/tests/behat/duplicate_lesson_page.feature @@ -20,12 +20,9 @@ Feature: In a lesson activity, a teacher can duplicate a lesson page | course | C1 | | activity | lesson | | name | Test lesson name | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "user private files" exist: - | user | filepath | filename | - | teacher1 | mod/lesson/tests/fixtures/moodle_logo.jpg | moodle_logo.jpg | + | user | filepath | + | teacher1 | mod/lesson/tests/fixtures/moodle_logo.jpg | And I log in as "teacher1" Scenario: Duplicate content page with an image. diff --git a/mod/lesson/tests/behat/questions_images.feature b/mod/lesson/tests/behat/questions_images.feature index 291753e4f59..ffba05741a6 100644 --- a/mod/lesson/tests/behat/questions_images.feature +++ b/mod/lesson/tests/behat/questions_images.feature @@ -20,12 +20,9 @@ Feature: In a lesson activity, teacher can add embedded images in questions answ | course | C1 | | activity | lesson | | name | Test lesson name | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "user private files" exist: - | user | filepath | filename | - | teacher1 | mod/lesson/tests/fixtures/moodle_logo.jpg | moodle_logo.jpg | + | user | filepath | + | teacher1 | mod/lesson/tests/fixtures/moodle_logo.jpg | And I log in as "teacher1" When I am on the "Test lesson name" "lesson activity" page And I follow "Add a question page" diff --git a/mod/quiz/tests/behat/manually_mark_question.feature b/mod/quiz/tests/behat/manually_mark_question.feature index aab1436f20c..2e05c62dd00 100644 --- a/mod/quiz/tests/behat/manually_mark_question.feature +++ b/mod/quiz/tests/behat/manually_mark_question.feature @@ -28,12 +28,9 @@ Feature: Teachers can override the grade for any question And quiz "Quiz 1" contains the following questions: | question | page | | TF1 | 1 | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "user private files" exist: - | user | filepath | filename | - | teacher1 | mod/quiz/tests/fixtures/moodle_logo.jpg | moodle_logo.jpg | + | user | filepath | + | teacher1 | mod/quiz/tests/fixtures/moodle_logo.jpg | And I am on the "Quiz 1" "mod_quiz > View" page logged in as "student1" And I press "Attempt quiz" And I follow "Finish attempt ..." diff --git a/mod/workshop/tests/behat/embedded_images.feature b/mod/workshop/tests/behat/embedded_images.feature index 031b0553b17..2b3569d267a 100644 --- a/mod/workshop/tests/behat/embedded_images.feature +++ b/mod/workshop/tests/behat/embedded_images.feature @@ -10,17 +10,14 @@ Feature: Teachers can embed images into instructions and conclusion fields | username | firstname | lastname | email | | teacher1 | Teacher | One | teacher1@example.com | And the following "user private files" exist: - | user | filepath | filename | - | teacher1 | mod/workshop/tests/fixtures/moodlelogo.png | moodlelogo.png | + | user | filepath | + | teacher1 | mod/workshop/tests/fixtures/moodlelogo.png | And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - And the following "blocks" exist: - | blockname | contextlevel | reference | pagetypepattern | defaultregion | - | private_files | System | 1 | my-index | side-post | And the following "activities" exist: | activity | course | name | | workshop | C1 | Workshop with embedded images |