From f4adbc8a11a7bb8baafa2ca12a60bd64220f4034 Mon Sep 17 00:00:00 2001 From: Ferran Recio Date: Wed, 13 Dec 2023 09:18:38 +0100 Subject: [PATCH] MDL-79029 behat: replace deprecated behat steps --- .../tests/behat/add_filetypes.feature | 3 +- .../tests/behat/conditional_bug.feature | 15 ++------ .../tests/behat/private_ruleset.feature | 3 +- .../site_default_activity_completion.feature | 9 ++--- .../tests/behat/edit_delete_sections.feature | 2 +- course/tests/behat/add_activities.feature | 37 +++++-------------- .../restrict_available_activities.feature | 4 +- .../tests/behat/add_custom_file_type.feature | 31 ++++++++-------- lib/form/tests/behat/hideif.feature | 6 +-- .../videojs/tests/behat/modules.feature | 2 +- .../tests/behat/outcome_grading.feature | 10 ++--- mod/assign/tests/behat/quickgrading.feature | 3 +- .../tests/behat/add_instance.feature | 10 ++--- .../tests/behat/show_nonrespondents.feature | 4 +- mod/forum/tests/behat/add_forum.feature | 7 +--- .../tests/behat/contentbank_link.feature | 15 +++----- .../tests/behat/define_settings.feature | 2 +- .../behat/inline_editing_content.feature | 7 ++-- .../behat/imscp_activity_creation_ui.feature | 5 +-- mod/lti/tests/behat/addtool.feature | 4 +- mod/lti/tests/behat/contentitem.feature | 2 +- mod/lti/tests/behat/managecoursetools.feature | 6 +-- .../seb/tests/behat/edit_form.feature | 6 +-- .../settings_form_fields_disableif.feature | 3 +- mod/scorm/tests/behat/add_scorm.feature | 3 +- mod/scorm/tests/behat/missing_org.feature | 3 +- mod/survey/tests/behat/survey_types.feature | 5 +-- .../tests/behat/submission_types.feature | 3 +- .../tests/behat/workshop_edit_form.feature | 5 +-- .../tests/behat/loglive_report.feature | 5 +-- .../tests/behat/file_update.feature | 6 +-- repository/tests/behat/create_folders.feature | 3 +- .../tests/behat/create_shortcut.feature | 3 +- repository/tests/behat/overwrite_file.feature | 2 +- repository/tests/behat/zip_and_unzip.feature | 2 +- 35 files changed, 85 insertions(+), 151 deletions(-) diff --git a/admin/tool/filetypes/tests/behat/add_filetypes.feature b/admin/tool/filetypes/tests/behat/add_filetypes.feature index 13b1e2acba3..870cc8a5579 100644 --- a/admin/tool/filetypes/tests/behat/add_filetypes.feature +++ b/admin/tool/filetypes/tests/behat/add_filetypes.feature @@ -120,8 +120,7 @@ Feature: Add customised file types | Custom description | Froggy file | And I press "Save changes" # Create a resource activity and add it to a course - And I am on "Course 1" course homepage with editing mode on - When I add a "File" to section "1" + When I add a resource activity to course "Course 1" section "1" And I set the following fields to these values: | Name | An example of customised file type | | Description | File description | diff --git a/availability/condition/completion/tests/behat/conditional_bug.feature b/availability/condition/completion/tests/behat/conditional_bug.feature index 419ebd01810..fb2963956cc 100644 --- a/availability/condition/completion/tests/behat/conditional_bug.feature +++ b/availability/condition/completion/tests/behat/conditional_bug.feature @@ -6,8 +6,8 @@ Feature: Confirm that conditions on completion no longer cause a bug Background: Given the following "courses" exist: - | fullname | shortname | format | - | Course 1 | C1 | topics | + | fullname | shortname | format | enablecompletion | + | Course 1 | C1 | topics | 1 | And the following "users" exist: | username | | teacher1 | @@ -17,21 +17,14 @@ Feature: Confirm that conditions on completion no longer cause a bug @javascript Scenario: Multiple completion conditions on glossary - # Set up course. - Given I am on the "Course 1" "course" page logged in as "teacher1" - And I navigate to "Settings" in current page administration - And I expand all fieldsets - And I set the field "Enable completion tracking" to "Yes" - And I press "Save and display" - And I turn editing mode on # Add a couple of Pages with manual completion. And the following "activities" exist: | activity | course | name | completion | | page | C1 | Page1 | 1 | | page | C1 | Page2 | 1 | - + And I log in as "teacher1" # Add a Glossary. - When I add a "Glossary" to section "1" + When I add a glossary activity to course "Course 1" section "1" And I set the following fields to these values: | Name | TestGlossary | And I expand all fieldsets diff --git a/availability/tests/behat/private_ruleset.feature b/availability/tests/behat/private_ruleset.feature index 142f9858d4a..fa60a6948a4 100644 --- a/availability/tests/behat/private_ruleset.feature +++ b/availability/tests/behat/private_ruleset.feature @@ -21,8 +21,7 @@ Feature: Private rule sets | Group A | C1 | GA | 0 | | Group B | C1 | GB | 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Page" to section "1" + And I add a page activity to course "Course 1" section "1" And I expand all fieldsets Scenario: Add restriction with visible condition (must match), display option should be active diff --git a/completion/tests/behat/site_default_activity_completion.feature b/completion/tests/behat/site_default_activity_completion.feature index 11998070dd8..0d2f2ad4a15 100644 --- a/completion/tests/behat/site_default_activity_completion.feature +++ b/completion/tests/behat/site_default_activity_completion.feature @@ -17,8 +17,7 @@ Feature: Allow admins to edit the default activity completion rules at site leve | course | C1 | | name | Test assignment one | | completion | 1 | - And I am on "Course 1" course homepage with editing mode on - When I add a "Assignment" to section "0" + When I add a assign activity to course "Course 1" section "0" And I expand all fieldsets # Completion tracking 0 = Do not indicate activity completion. Then the field "None" matches value "1" @@ -39,8 +38,7 @@ Feature: Allow admins to edit the default activity completion rules at site leve And the following "core_completion > Course default" exist: | course | module | completion | completionview | completionusegrade | completionsubmit | | Acceptance test site | assign | 2 | 0 | 1 | 1 | - And I am on "Course 1" course homepage with editing mode on - When I add a "Assignment" to section "0" + When I add a assign activity to course "Course 1" section "0" And I expand all fieldsets Then the field "Add requirements" matches value "1" And the field "completionview" matches value "0" @@ -64,8 +62,7 @@ Feature: Allow admins to edit the default activity completion rules at site leve | course | module | completion | completionview | completionusegrade | completionsubmit | | Acceptance test site | assign | 2 | 0 | 1 | 1 | | C1 | assign | 2 | 1 | 0 | 1 | - And I am on "Course 1" course homepage with editing mode on - When I add a "Assignment" to section "0" + When I add a assign activity to course "Course 1" section "0" And I expand all fieldsets Then the field "Add requirements" matches value "1" And the field "completionview" matches value "1" diff --git a/course/format/topics/tests/behat/edit_delete_sections.feature b/course/format/topics/tests/behat/edit_delete_sections.feature index e556c85f52f..cf7f35b4d2e 100644 --- a/course/format/topics/tests/behat/edit_delete_sections.feature +++ b/course/format/topics/tests/behat/edit_delete_sections.feature @@ -93,7 +93,7 @@ Feature: Sections can be edited and deleted in topics format @javascript Scenario: Add a topic and then add an activity in it When I click on "Add topic" "link" in the "Topic 5" "section" - And I add a "Assignment" to section "6" and I fill the form with: + And I add an assign activity to course "Course 1" section "6" and I fill the form with: | Assignment name | Very new activity | | Description | Test | Then I should see "Very new activity" in the "Topic 6" "section" diff --git a/course/tests/behat/add_activities.feature b/course/tests/behat/add_activities.feature index 47d76d7ec0c..bf4c2254807 100644 --- a/course/tests/behat/add_activities.feature +++ b/course/tests/behat/add_activities.feature @@ -9,56 +9,44 @@ Feature: Add activities to courses | fullname | shortname | format | | Course 1 | Course 1 | topics | - @javascript Scenario: Add an activity to a course - Given I am on the "Course 1" Course page logged in as admin - And I am on "Course 1" course homepage with editing mode on - When I add a "Database" to section "3" and I fill the form with: + Given I log in as "admin" + When I add a data activity to course "Course 1" section "3" and I fill the form with: | Name | Test name | | Description | Test database description | | ID number | TESTNAME | | Allow comments on entries | Yes | | Force language | English | - And I turn editing mode off Then I should not see "Adding a new" - And I turn editing mode on - And I open "Test name" actions menu - And I click on "Edit settings" "link" in the "Test name" activity + And I am on the "Test name" "data activity editing" page And the following fields match these values: | Name | Test name | | ID number | TESTNAME | | Allow comments on entries | Yes | | Force language | English ‎(en)‎ | - @javascript Scenario: Add an activity supplying only the name - Given I am on the "Course 1" Course page logged in as admin - And I am on "Course 1" course homepage with editing mode on - When I add a "Database" to section "3" and I fill the form with: + Given I log in as "admin" + When I add a data activity to course "Course 1" section "3" and I fill the form with: | Name | Test name | Then I should see "Test name" - @javascript Scenario: Set activity description to required then add an activity supplying only the name Given the following config values are set as admin: | requiremodintro | 1 | - And I am on the "Course 1" Course page logged in as admin - And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "3" and I fill the form with: + And I log in as "admin" + And I add a data activity to course "Course 1" section "3" and I fill the form with: | Name | Test name | Then I should see "Required" - @javascript Scenario: The activity description should use the user's preferred editor on creation Given the following "user preferences" exist: | user | preference | value | | admin | htmleditor | textarea | And I am logged in as admin - And I am on "Course 1" course homepage with editing mode on - When I add a "Database" to section "3" + When I add a data activity to course "Course 1" section "3" Then the field "Description format" matches value "0" - @javascript Scenario: The activity description should preserve the format used once edited (markdown version) Given the following "activities" exist: | activity | name | intro | introformat | course | @@ -67,12 +55,9 @@ Feature: Add activities to courses | user | preference | value | | admin | htmleditor | textarea | And I am logged in as admin - And I am on "Course 1" course homepage with editing mode on - And I open "A4" actions menu - When I click on "Edit settings" "link" in the "A4" activity + When I am on the "A4" "assign activity editing" page Then the field "Description format" matches value "4" - @javascript Scenario: The activity description should preserve the format used once edited (plain text version) Given the following "activities" exist: | activity | name | intro | introformat | course | @@ -81,7 +66,5 @@ Feature: Add activities to courses | user | preference | value | | admin | htmleditor | textarea | And I am logged in as admin - And I am on "Course 1" course homepage with editing mode on - And I open "A2" actions menu - When I click on "Edit settings" "link" in the "A2" activity + When I am on the "A2" "assign activity editing" page Then the field "Description format" matches value "2" diff --git a/course/tests/behat/restrict_available_activities.feature b/course/tests/behat/restrict_available_activities.feature index 74ef9e0d61b..3a01d8ea51e 100644 --- a/course/tests/behat/restrict_available_activities.feature +++ b/course/tests/behat/restrict_available_activities.feature @@ -18,11 +18,9 @@ Feature: Restrict activities availability | activity | course | name | | chat | C1 | Test chat name | - @javascript Scenario: Activities can be added with the default permissions Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - When I add a "Glossary" to section "1" and I fill the form with: + When I add a glossary activity to course "Course 1" section "1" and I fill the form with: | Name | Test glossary name | | Description | Test glossary description | Then I should see "Test glossary name" diff --git a/files/tests/behat/add_custom_file_type.feature b/files/tests/behat/add_custom_file_type.feature index c5aa2c8ce8b..4416154ef2e 100644 --- a/files/tests/behat/add_custom_file_type.feature +++ b/files/tests/behat/add_custom_file_type.feature @@ -8,32 +8,31 @@ Feature: Add a new custom file type Scenario: Add custom file type Given the following "courses" exist: | fullname | shortname | category | legacyfiles | - | Course 1 | C1 | 0 | 2 | + | Course 1 | C1 | 0 | 2 | And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | + | user | course | role | + | teacher1 | C1 | editingteacher | And I log in as "admin" And I navigate to "Server > File types" in site administration And I press "Add a new file type" And I set the following fields to these values: - | Extension | mdlr | - | MIME type | application/x-moodle-rules | - | File icon | document | - | Description type | Custom description specified in this form | - | Custom description | Moodle rules | + | Extension | mdlr | + | MIME type | application/x-moodle-rules | + | File icon | document | + | Description type | Custom description specified in this form | + | Custom description | Moodle rules | And I press "Save changes" And I should see "application/x-moodle-rules" - And I am on the "Course 1" course page logged in as teacher1 - And I turn editing mode on - When I add a "File" to section "1" and I fill the form with: - | Name | Test file | - | Select files | files/tests/fixtures/custom_filetype.mdlr | - | Show size | 1 | - | Show type | 1 | - | Display resource description | 1 | + And I log in as "teacher1" + When I add a resource activity to course "Course 1" section "1" and I fill the form with: + | Name | Test file | + | Select files | files/tests/fixtures/custom_filetype.mdlr | + | Show size | 1 | + | Show type | 1 | + | Display resource description | 1 | And I am on "Course 1" course homepage Then I should see "Test file" And I should see "MDLR" in the "span.activitybadge" "css_element" diff --git a/lib/form/tests/behat/hideif.feature b/lib/form/tests/behat/hideif.feature index 04027bacd1b..0ef1509e6c3 100644 --- a/lib/form/tests/behat/hideif.feature +++ b/lib/form/tests/behat/hideif.feature @@ -9,11 +9,9 @@ Feature: hideIf functionality in forms | fullname | shortname | | Course 1 | C1 | And I log in as "admin" - And I am on "Course 1" course homepage - And I turn editing mode on Scenario: When 'eq' hideIf conditions are not met, the relevant elements are shown - When I add a "Assignment" to section "1" + When I add an assign activity to course "Course 1" section "1" And I expand all fieldsets And I set the field "Students submit in groups" to "Yes" Then I should see "Require group to make submission" @@ -21,7 +19,7 @@ Feature: hideIf functionality in forms And I should see "Grouping for student groups" Scenario: When 'eq' hideIf conditions are met, the relevant elements are hidden - When I add a "Assignment" to section "1" + When I add a assign activity to course "Course 1" section "1" And I expand all fieldsets And I set the field "Students submit in groups" to "No" Then I should not see "Require group to make submission" diff --git a/media/player/videojs/tests/behat/modules.feature b/media/player/videojs/tests/behat/modules.feature index 90da7466d20..e02bcd63d25 100644 --- a/media/player/videojs/tests/behat/modules.feature +++ b/media/player/videojs/tests/behat/modules.feature @@ -24,7 +24,7 @@ Feature: Embed videos without the media filter @javascript Scenario: Add a video as a File resource. Make sure media filters work - When I add a "File" to section "1" + When I add a "File" to section "1" using the activity chooser And I set the following fields to these values: | Name | Video File | | Description | Example of a video file | diff --git a/mod/assign/tests/behat/outcome_grading.feature b/mod/assign/tests/behat/outcome_grading.feature index 7ad077fa17e..42ffe41310e 100644 --- a/mod/assign/tests/behat/outcome_grading.feature +++ b/mod/assign/tests/behat/outcome_grading.feature @@ -1,4 +1,4 @@ -@mod @mod_assign @core_outcome @javascript +@mod @mod_assign @core_outcome Feature: Outcome grading In order to give an outcome to my student As a teacher @@ -31,10 +31,10 @@ Feature: Outcome grading And I click on "#add" "css_element" And I log out + @javascript Scenario: Giving an outcome to a student Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: + And I add a assign activity to course "Course 1" section "1" and I fill the form with: | Assignment name | Test assignment name | | ID number | Test assignment name | | Description | Test assignment description | @@ -57,6 +57,7 @@ Feature: Outcome grading Then I should see "Outcome Test: Excellent" in the "Student 0" "table_row" And I should not see "Outcome Test: Excellent" in the "Student 1" "table_row" + @javascript Scenario: Giving an outcome to a group submission Given the following "users" exist: | username | firstname | lastname | email | @@ -72,8 +73,7 @@ Feature: Outcome grading | student0 | G1 | | student1 | G1 | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: + And I add a assign activity to course "Course 1" section "1" and I fill the form with: | Assignment name | Test assignment name | | Description | Test assignment description | | ID number | Test assignment name | diff --git a/mod/assign/tests/behat/quickgrading.feature b/mod/assign/tests/behat/quickgrading.feature index bb6bd36a7be..99c2a68f660 100644 --- a/mod/assign/tests/behat/quickgrading.feature +++ b/mod/assign/tests/behat/quickgrading.feature @@ -68,8 +68,7 @@ Feature: In an assignment, teachers grade multiple students on one page | Short name | skillZ! | | Scale | 1337dom scale | And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Assignment" to section "1" and I fill the form with: + And I add a assign activity to course "Course 1" section "1" and I fill the form with: | Assignment name | Test assignment name | | Description | Submit your online text | | assignsubmission_onlinetext_enabled | 1 | diff --git a/mod/bigbluebuttonbn/tests/behat/add_instance.feature b/mod/bigbluebuttonbn/tests/behat/add_instance.feature index a691db60590..55516b52628 100644 --- a/mod/bigbluebuttonbn/tests/behat/add_instance.feature +++ b/mod/bigbluebuttonbn/tests/behat/add_instance.feature @@ -36,16 +36,14 @@ Feature: bigbluebuttonbn instance And I should see "Recordings" Scenario: Add a Recording Only activity and check that no live session settings are available for this instance type - When I turn editing mode on - And I change window size to "large" - And I add a "BigBlueButton" to section "1" + When I change window size to "large" + And I add a bigbluebuttonbn activity to course "Test course" section "1" And I select "Recordings only" from the "Instance type" singleselect Then I should not see "Lock settings" Scenario Outline: Add an activity and check that required settings are available for the three types of instance types - When I turn editing mode on - And I change window size to "large" - And I add a "BigBlueButton" to section "1" + When I change window size to "large" + And I add a bigbluebuttonbn activity to course "Test course" section "1" And I select "" from the "Instance type" singleselect Then I should see "Restrict access" diff --git a/mod/feedback/tests/behat/show_nonrespondents.feature b/mod/feedback/tests/behat/show_nonrespondents.feature index c7053c99874..00902ed44c2 100644 --- a/mod/feedback/tests/behat/show_nonrespondents.feature +++ b/mod/feedback/tests/behat/show_nonrespondents.feature @@ -34,12 +34,10 @@ Feature: Show users who have not responded to the feedback survey | grouping | group | | GXI1 | GI1 | - @javascript Scenario: See users who have not responded # Set up a feedback. When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Feedback" to section "1" and I fill the form with: + And I add a feedback activity to course "Course 1" section "1" and I fill the form with: | Name | Frogs | | Description | x | | Record user names | User's name will be logged and shown with answers | diff --git a/mod/forum/tests/behat/add_forum.feature b/mod/forum/tests/behat/add_forum.feature index e88dd30c7e3..203e056e7ad 100644 --- a/mod/forum/tests/behat/add_forum.feature +++ b/mod/forum/tests/behat/add_forum.feature @@ -18,8 +18,7 @@ Feature: Add forum activities and discussions | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: + And I add a forum activity to course "Course 1" section "1" and I fill the form with: | Forum name | Test forum name | | Forum type | Standard forum for general use | | Description | Test forum description | @@ -43,14 +42,12 @@ Feature: Add forum activities and discussions And I follow "Edit" And the field "Attachment" matches value "empty.txt" - @javascript Scenario: Test forum settings validation Given the following "courses" exist: | fullname | shortname | category | | Course 1 | C1 | 0 | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "0" and I fill the form with: + And I add a forum activity to course "Course 1" section "0" and I fill the form with: | Forum name | Test forum | | Forum type | single | | Group mode | 1 | diff --git a/mod/h5pactivity/tests/behat/contentbank_link.feature b/mod/h5pactivity/tests/behat/contentbank_link.feature index ed75005db1e..423d724bc60 100644 --- a/mod/h5pactivity/tests/behat/contentbank_link.feature +++ b/mod/h5pactivity/tests/behat/contentbank_link.feature @@ -24,8 +24,7 @@ Feature: Content bank link in the activity settings form @javascript Scenario: The content bank link should go to the course Content bank When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" Then I should see "Use the content bank (opens in new window) to manage your H5P files" And I click on "content bank (opens in new window)" "link" in the "General" "fieldset" And I switch to a second window @@ -39,15 +38,13 @@ Feature: Content bank link in the activity settings form | capability | permission | role | contextlevel | reference | | moodle/contentbank:access | Prevent | editingteacher | Course | C1 | When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" Then I should not see "Use the content Bank (opens in new window) to manage your H5P files" @javascript Scenario: A different message should be displayed if the package file is a link to the content bank file Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added with link to content bank | | Description | Description | @@ -69,8 +66,7 @@ Feature: Content bank link in the activity settings form @javascript Scenario: The content bank link should go to the course Content bank if the file is a copy to a content bank file Given I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added with link to content bank | | Description | Description | @@ -93,8 +89,7 @@ Feature: Content bank link in the activity settings form 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 "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added with link to content bank | | Description | Description | diff --git a/mod/h5pactivity/tests/behat/define_settings.feature b/mod/h5pactivity/tests/behat/define_settings.feature index 4346224fd38..945c6127ad2 100644 --- a/mod/h5pactivity/tests/behat/define_settings.feature +++ b/mod/h5pactivity/tests/behat/define_settings.feature @@ -19,7 +19,7 @@ Feature: Set up attempt grading options into H5P activity | moodle/h5p:updatelibraries | Allow | editingteacher | System | | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" Scenario: Default values should have tracking and grading When the field "Type" matches value "Point" diff --git a/mod/h5pactivity/tests/behat/inline_editing_content.feature b/mod/h5pactivity/tests/behat/inline_editing_content.feature index c1878204215..231c5a15852 100644 --- a/mod/h5pactivity/tests/behat/inline_editing_content.feature +++ b/mod/h5pactivity/tests/behat/inline_editing_content.feature @@ -37,7 +37,7 @@ Feature: Inline editing H5P content | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present # Create an H5P activity with a link to the content-bank file. - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added as link to content bank | | Description | Description | @@ -99,7 +99,7 @@ Feature: Inline editing H5P content | unaddableblocks | | theme_boost| And I add the "Navigation" block if not present # Create an H5P activity with a copy to the content-bank file. - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added as copy to content bank | | Description | Description | @@ -157,8 +157,7 @@ Feature: Inline editing H5P content And I upload "h5p/tests/fixtures/greeting-card.h5p" file to "Files" filemanager And I click on "Save changes" "button" # Create an H5P activity with a private user file. - And I am on "Course 1" course homepage with editing mode on - And I add a "H5P" to section "1" + And I add an h5pactivity activity to course "Course 1" section "1" And I set the following fields to these values: | Name | H5P package added as private user file | | Description | Description | diff --git a/mod/imscp/tests/behat/imscp_activity_creation_ui.feature b/mod/imscp/tests/behat/imscp_activity_creation_ui.feature index d556d8e891b..b5295aa5067 100644 --- a/mod/imscp/tests/behat/imscp_activity_creation_ui.feature +++ b/mod/imscp/tests/behat/imscp_activity_creation_ui.feature @@ -8,9 +8,8 @@ Feature: Create an IMSCP activity through UI | Course 1 | C1 | topics | Scenario: IMS activity is created using UI - Given I am on the "Course 1" course page logged in as admin - And I turn editing mode on - And I add a "IMS content package" to section "1" + Given I log in as "admin" + And I add a imscp activity to course "Course 1" section "1" And I set the following fields to these values: | Name | Test IMS content package 2 | | Description | Test IMS content package description | diff --git a/mod/lti/tests/behat/addtool.feature b/mod/lti/tests/behat/addtool.feature index d6d8e88499e..7bfad61853e 100644 --- a/mod/lti/tests/behat/addtool.feature +++ b/mod/lti/tests/behat/addtool.feature @@ -27,7 +27,7 @@ Feature: Add tools Scenario: Add a site tool via the activity picker Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - When I add a "Teaching Tool 1" to section "1" + When I add a "Teaching Tool 1" to section "1" using the activity chooser And I set the field "Activity name" to "Test tool activity 1" And "Launch container" "field" should not be visible # For tool that does not support Content-Item message type, the Select content button must be disabled. @@ -44,7 +44,7 @@ Feature: Add tools Scenario: Add a course tool via the activity picker Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - When I add a "Course tool 1" to section "1" + When I add a "Course tool 1" to section "1" using the activity chooser And I set the field "Activity name" to "Test tool activity 2" And "Launch container" "field" should not be visible # For tool that does not support Content-Item message type, the Select content button must be disabled. diff --git a/mod/lti/tests/behat/contentitem.feature b/mod/lti/tests/behat/contentitem.feature index 0e3ad75cd97..34192172e6d 100644 --- a/mod/lti/tests/behat/contentitem.feature +++ b/mod/lti/tests/behat/contentitem.feature @@ -22,7 +22,7 @@ Feature: Content-Item support Scenario: Tool that supports Deep Linking should be able to configure a tool via the Select content button Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - When I add a "Teaching Tool 1" to section "1" + When I add a "Teaching Tool 1" to section "1" using the activity chooser Then "Select content" "button" should be visible And the "Select content" "button" should be enabled diff --git a/mod/lti/tests/behat/managecoursetools.feature b/mod/lti/tests/behat/managecoursetools.feature index 6cf81494140..722aa94d260 100644 --- a/mod/lti/tests/behat/managecoursetools.feature +++ b/mod/lti/tests/behat/managecoursetools.feature @@ -255,10 +255,10 @@ Feature: Manage course tools | Course Tool 1 | Example description | https://example.com/tool | C1 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Teaching Tool 1" to section "1" + And I add a "Teaching Tool 1" to section "1" using the activity chooser And I set the field "Activity name" to "Test tool activity 1" And I press "Save and return to course" - And I add a "Course Tool 1" to section "1" + And I add a "Course Tool 1" to section "1" using the activity chooser And I set the field "Activity name" to "Course tool activity 1" And I press "Save and return to course" And I navigate to "LTI External tools" in current page administration @@ -266,7 +266,7 @@ Feature: Manage course tools And I click on "Show in activity chooser" "field" in the "Teaching Tool 2" "table_row" And I click on "Don't show in activity chooser" "field" in the "Course Tool 1" "table_row" And I am on "Course 1" course homepage - And I add a "Teaching Tool 2" to section "1" + And I add a "Teaching Tool 2" to section "1" using the activity chooser And I set the field "Activity name" to "Test tool activity 2" And I press "Save and return to course" When I backup "Course 1" course using this options: diff --git a/mod/quiz/accessrule/seb/tests/behat/edit_form.feature b/mod/quiz/accessrule/seb/tests/behat/edit_form.feature index 2466304fc1b..9f6eef9b17a 100644 --- a/mod/quiz/accessrule/seb/tests/behat/edit_form.feature +++ b/mod/quiz/accessrule/seb/tests/behat/edit_form.feature @@ -46,14 +46,12 @@ Feature: Safe Exam Browser settings in quiz edit form | course | C1 | | role | editingteacher | And I log in as "teacher" - And I am on "Course 1" course homepage with editing mode on # Create the quiz. - When I add a "Quiz" to section "0" and I fill the form with: + When I add a quiz activity to course "Course 1" section "0" and I fill the form with: | Name | My quiz | Then I should not see "Adding a new Quiz" # Edit the quiz. - And I open "My quiz" actions menu - And I click on "Edit settings" "link" in the "My quiz" activity + And I am on the "My quiz" "quiz activity editing" page And I set the field "Name" to "My quiz edited" And I press "Save and return to course" And I should not see "Updating: Quiz" diff --git a/mod/quiz/tests/behat/settings_form_fields_disableif.feature b/mod/quiz/tests/behat/settings_form_fields_disableif.feature index 8062d3e0e56..059e912251d 100644 --- a/mod/quiz/tests/behat/settings_form_fields_disableif.feature +++ b/mod/quiz/tests/behat/settings_form_fields_disableif.feature @@ -96,8 +96,7 @@ Feature: Settings form fields disabled if not required @javascript Scenario: Depending on whether there is a close date, some review options are disabled. When I log in as "teacher" - And I am on "Course 1" course homepage with editing mode on - And I add a "Quiz" to section "1" + And I add a quiz activity to course "Course 1" section "1" And I expand all fieldsets And I set the field "Name" to "Test quiz" Then the "id_attemptclosed" "checkbox" should be disabled diff --git a/mod/scorm/tests/behat/add_scorm.feature b/mod/scorm/tests/behat/add_scorm.feature index 3cdbdfbb626..a617e23435d 100644 --- a/mod/scorm/tests/behat/add_scorm.feature +++ b/mod/scorm/tests/behat/add_scorm.feature @@ -18,8 +18,7 @@ Feature: Add scorm activity | teacher1 | C1 | editingteacher | | student1 | C1 | student | When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "SCORM package" to section "1" + And I add a scorm activity to course "Course 1" section "1" And I set the following fields to these values: | Name | Awesome SCORM package | | Description | Description | diff --git a/mod/scorm/tests/behat/missing_org.feature b/mod/scorm/tests/behat/missing_org.feature index 85f7c7292d9..f6fbaa7098e 100644 --- a/mod/scorm/tests/behat/missing_org.feature +++ b/mod/scorm/tests/behat/missing_org.feature @@ -15,8 +15,7 @@ Feature: Check a SCORM package with missing Organisational structure. | teacher1 | C1 | editingteacher | | student1 | C1 | student | When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "SCORM package" to section "1" + And I add a scorm activity to course "Course 1" section "1" And I set the following fields to these values: | Name | MissingOrg SCORM package | | Description | Description | diff --git a/mod/survey/tests/behat/survey_types.feature b/mod/survey/tests/behat/survey_types.feature index 5b7fc34d548..e29adc9fa22 100644 --- a/mod/survey/tests/behat/survey_types.feature +++ b/mod/survey/tests/behat/survey_types.feature @@ -37,11 +37,8 @@ Feature: A teacher can set three types of survey activity And I should see "In this online unit..." And I should see "my learning focuses on issues that interest me." - @javascript Scenario: Survey activity is created via UI - Given I am on the "Course 1" course page - And I turn editing mode on - And I add a "Survey" to section "1" + Given I add a survey activity to course "Course 1" section "1" And I set the following fields to these values: | Name | Test survey name | | Description | Test survey description | diff --git a/mod/workshop/tests/behat/submission_types.feature b/mod/workshop/tests/behat/submission_types.feature index 299063d015d..e72c111792a 100644 --- a/mod/workshop/tests/behat/submission_types.feature +++ b/mod/workshop/tests/behat/submission_types.feature @@ -12,8 +12,7 @@ Feature: Submission types @javascript Scenario: Test workshop settings validation - Given I am on "Test" course homepage with editing mode on - And I add a "Workshop" to section "0" + Given I add a workshop activity to course "Test" section "0" When I set the following fields to these values: | Workshop name | Test workshop | | submissiontypetextavailable | 0 | diff --git a/mod/workshop/tests/behat/workshop_edit_form.feature b/mod/workshop/tests/behat/workshop_edit_form.feature index 55f200508bd..6026735386a 100644 --- a/mod/workshop/tests/behat/workshop_edit_form.feature +++ b/mod/workshop/tests/behat/workshop_edit_form.feature @@ -17,12 +17,9 @@ Feature: Workshop assessment with grade to pass | student1 | c1 | student | | teacher1 | c1 | editingteacher | - @javascript Scenario: Setup workshop with assessment grade and pass grade set And I log in as "teacher1" - And I am on "Course1" course homepage with editing mode on - And I add a "Workshop" to section "0" - And I expand all fieldsets + And I add a workshop activity to course "Course1" section "0" When I set the following fields to these values: | Workshop name | Test workshop | | Add requirements | 1 | diff --git a/report/loglive/tests/behat/loglive_report.feature b/report/loglive/tests/behat/loglive_report.feature index 9903d241855..29734046b86 100644 --- a/report/loglive/tests/behat/loglive_report.feature +++ b/report/loglive/tests/behat/loglive_report.feature @@ -18,8 +18,7 @@ Feature: In a report, admin can see loglive data | fullnamedisplay | firstname | | alternativefullnameformat | middlename, alternatename, firstname, lastname | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Database" to section "3" and I fill the form with: + And I add a data activity to course "Course 1" section "3" and I fill the form with: | Name | Test name | | Description | Test database description | @@ -40,7 +39,7 @@ Feature: In a report, admin can see loglive data And I am on "Course 1" course homepage And I change window size to "large" And I reload the page - And I add a "Database" to section "3" and I fill the form with: + And I add a data activity to course "Course 1" section "3" and I fill the form with: | Name | Test name2 | | Description | Test database description | And I switch to the main window diff --git a/repository/contentbank/tests/behat/file_update.feature b/repository/contentbank/tests/behat/file_update.feature index 89692c34483..13e7f6f47b4 100644 --- a/repository/contentbank/tests/behat/file_update.feature +++ b/repository/contentbank/tests/behat/file_update.feature @@ -17,8 +17,7 @@ Feature: Updating a file in the content bank after using in a course Scenario: Referenced files is the default option and updates alias as well When I log in as "admin" - And I am on "Course1" course homepage with editing mode on - And I add a "H5P" to section "1" + 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" @@ -59,8 +58,7 @@ Feature: Updating a file in the content bank after using in a course Scenario: Copied files should not be updated if the original is edited When I log in as "admin" - And I am on "Course1" course homepage with editing mode on - And I add a "H5P" to section "1" + 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" diff --git a/repository/tests/behat/create_folders.feature b/repository/tests/behat/create_folders.feature index be52aedfc82..b3fe68dd55b 100644 --- a/repository/tests/behat/create_folders.feature +++ b/repository/tests/behat/create_folders.feature @@ -10,8 +10,7 @@ Feature: Create folders in the file manager | fullname | shortname | category | | Course 1 | C1 | 0 | And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Folder" to section "0" + And I add a folder activity to course "Course 1" section "0" And I set the following fields to these values: | Name | Folder resource | | Description | The description | diff --git a/repository/tests/behat/create_shortcut.feature b/repository/tests/behat/create_shortcut.feature index 3063a037b80..3bfbfd2ac57 100644 --- a/repository/tests/behat/create_shortcut.feature +++ b/repository/tests/behat/create_shortcut.feature @@ -23,8 +23,7 @@ Feature: Create shortcuts And I upload "lib/tests/fixtures/empty.txt" file to "Files" filemanager Then I should see "empty.txt" in the "div.fp-content" "css_element" And I press "Save changes" - And I am on "Course 1" course homepage with editing mode on - And I add a "Folder" to section "1" + And I add a folder activity to course "Course 1" section "1" And I set the following fields to these values: | Name | Test folder | | Description | Test folder description | diff --git a/repository/tests/behat/overwrite_file.feature b/repository/tests/behat/overwrite_file.feature index b98c813e565..d58301d2402 100644 --- a/repository/tests/behat/overwrite_file.feature +++ b/repository/tests/behat/overwrite_file.feature @@ -32,7 +32,7 @@ Feature: Overwrite file feature And I should see "2" elements in "Files" filemanager And I press "Save changes" And I am on "Course 1" course homepage with editing mode on - And I add a "Folder" to section "1" + And I add a folder activity to course "Course 1" section "1" And I set the following fields to these values: | Name | Test folder | | Description | Test folder description | diff --git a/repository/tests/behat/zip_and_unzip.feature b/repository/tests/behat/zip_and_unzip.feature index ba2c61b7984..0b2c2f0d97a 100644 --- a/repository/tests/behat/zip_and_unzip.feature +++ b/repository/tests/behat/zip_and_unzip.feature @@ -11,7 +11,7 @@ Feature: Zip folders and unzip compressed files | Course 1 | C1 | 0 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Folder" to section "0" + And I add a folder activity to course "Course 1" section "0" And I set the following fields to these values: | Name | Folder resource | | Description | The description |