From 69ee5c33959c701726b3cc6504e5255b67ca7ba7 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 4 Jan 2024 16:21:59 +0100 Subject: [PATCH] MDL-80461 courseformat: Fix tests after replacing topic/week --- admin/tests/behat/resetindentation.feature | 110 ++++++++++----------- .../tests/behat/apply_presets.feature | 6 +- .../tests/behat/revert_changes.feature | 4 +- .../tool/usertours/tests/behat/tour_filter.feature | 2 +- .../ui/tests/behat/restore_moodle2_courses.feature | 30 +++--- .../tests/behat/create_course.feature | 2 +- .../tests/behat/edit_format_course.feature | 2 +- course/format/tests/base_test.php | 19 ++-- .../tests/behat/bulk_section_actions.feature | 90 ++++++++--------- course/format/tests/behat/bulk_select.feature | 88 ++++++++--------- .../behat/bulk_show_one_section_actions.feature | 32 +++--- .../format/tests/behat/course_courseindex.feature | 2 +- .../tests/behat/course_manageactivities.feature | 8 +- .../format/tests/behat/duplicate_section.feature | 2 +- .../tests/behat/edit_delete_sections.feature | 36 +++---- .../topics/tests/behat/highlight_sections.feature | 2 +- .../format/weeks/tests/behat/bulk_actions.feature | 84 ++++++++-------- .../format/weeks/tests/behat/current_week.feature | 4 +- .../weeks/tests/behat/edit_delete_sections.feature | 8 +- .../course_category_management_listing.feature | 4 +- .../tests/behat/course_collapse_sections.feature | 12 +-- course/tests/behat/course_format.feature | 18 ++-- course/tests/behat/frontpage_topic_section.feature | 6 +- course/tests/behat/max_number_sections.feature | 4 +- course/tests/behat/section_highlighting.feature | 2 +- course/tests/behat/sectionzero_title.feature | 6 +- .../reportbuilder/datasource/courses_test.php | 2 +- 27 files changed, 296 insertions(+), 289 deletions(-) diff --git a/admin/tests/behat/resetindentation.feature b/admin/tests/behat/resetindentation.feature index d9307558021..33a15a3e698 100644 --- a/admin/tests/behat/resetindentation.feature +++ b/admin/tests/behat/resetindentation.feature @@ -7,35 +7,35 @@ Feature: Reset course indentation Background: Given the following "courses" exist: | fullname | shortname | format | - | Topics Course 1 | T1 | topics | - | Topics Course 2 | T2 | topics | + | Sections Course 1 | T1 | topics | + | Sections Course 2 | T2 | topics | | Weekly Course 1 | W1 | weeks | | Weekly Course 2 | W2 | weeks | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Topics forum name | Topics forum description | T1 | forum1 | - | data | Topics database name | Topics database description | T1 | data1 | - | wiki | Topics wiki name | Topics wiki description | T2 | wiki1 | - | forum | Weekly forum name | Weekly forum description | W1 | forum2 | - | data | Weekly database name | Weekly database description | W1 | data2 | - | wiki | Weekly wiki name | Weekly wiki description | W2 | wiki2 | + | activity | name | intro | course | idnumber | + | forum | Sections forum name | Sections forum description | T1 | forum1 | + | data | Sections database name | Sections database description | T1 | data1 | + | wiki | Sections wiki name | Sections wiki description | T2 | wiki1 | + | forum | Weekly forum name | Weekly forum description | W1 | forum2 | + | data | Weekly database name | Weekly database description | W1 | data2 | + | wiki | Weekly wiki name | Weekly wiki description | W2 | wiki2 | And I log in as "admin" - And I am on "Topics Course 1" course homepage with editing mode on - And I open "Topics forum name" actions menu - And I click on "Move right" "link" in the "Topics forum name" activity - And I open "Topics forum name" actions menu - And "Move right" "link" in the "Topics forum name" "activity" should not be visible - And "Move left" "link" in the "Topics forum name" "activity" should be visible + And I am on "Sections Course 1" course homepage with editing mode on + And I open "Sections forum name" actions menu + And I click on "Move right" "link" in the "Sections forum name" activity + And I open "Sections forum name" actions menu + And "Move right" "link" in the "Sections forum name" "activity" should not be visible + And "Move left" "link" in the "Sections forum name" "activity" should be visible And I press the escape key - And I open "Topics database name" actions menu - And "Move right" "link" in the "Topics database name" "activity" should be visible - And "Move left" "link" in the "Topics database name" "activity" should not be visible - And I am on "Topics Course 2" course homepage with editing mode on - And I open "Topics wiki name" actions menu - And I click on "Move right" "link" in the "Topics wiki name" activity - And I open "Topics wiki name" actions menu - And "Move right" "link" in the "Topics wiki name" "activity" should not be visible - And "Move left" "link" in the "Topics wiki name" "activity" should be visible + And I open "Sections database name" actions menu + And "Move right" "link" in the "Sections database name" "activity" should be visible + And "Move left" "link" in the "Sections database name" "activity" should not be visible + And I am on "Sections Course 2" course homepage with editing mode on + And I open "Sections wiki name" actions menu + And I click on "Move right" "link" in the "Sections wiki name" activity + And I open "Sections wiki name" actions menu + And "Move right" "link" in the "Sections wiki name" "activity" should not be visible + And "Move left" "link" in the "Sections wiki name" "activity" should be visible And I am on "Weekly Course 1" course homepage with editing mode on And I open "Weekly forum name" actions menu And I click on "Move right" "link" in the "Weekly forum name" activity @@ -54,7 +54,7 @@ Feature: Reset course indentation And "Move left" "link" in the "Weekly wiki name" "activity" should be visible Scenario Outline: Apply course indentation reset - Given I navigate to "Plugins > Course formats > format" in site administration + Given I navigate to "Plugins > Course formats > " in site administration And I wait "5" seconds And "Reset indentation sitewide" "link" should exist When I click on "Reset indentation sitewide" "link" @@ -62,31 +62,31 @@ Feature: Reset course indentation And "Reset indentation sitewide" "button" should exist And I click on "Reset indentation sitewide" "button" Then I should see "Indentation reset." - And I am on " Course 1" course homepage with editing mode on - And I open " forum name" actions menu - And "Move right" "link" in the " forum name" "activity" should be visible - And "Move left" "link" in the " forum name" "activity" should not be visible + And I am on " Course 1" course homepage with editing mode on + And I open " forum name" actions menu + And "Move right" "link" in the " forum name" "activity" should be visible + And "Move left" "link" in the " forum name" "activity" should not be visible And I press the escape key - And I open " database name" actions menu - And "Move right" "link" in the " database name" "activity" should be visible - And "Move left" "link" in the " database name" "activity" should not be visible - And I am on " Course 2" course homepage with editing mode on - And I open " wiki name" actions menu - And "Move right" "link" in the " wiki name" "activity" should be visible - And "Move left" "link" in the " wiki name" "activity" should not be visible -# Check other course formats had not been reset + And I open " database name" actions menu + And "Move right" "link" in the " database name" "activity" should be visible + And "Move left" "link" in the " database name" "activity" should not be visible + And I am on " Course 2" course homepage with editing mode on + And I open " wiki name" actions menu + And "Move right" "link" in the " wiki name" "activity" should be visible + And "Move left" "link" in the " wiki name" "activity" should not be visible + # Check other course formats had not been reset And I am on " Course 1" course homepage with editing mode on And I open " forum name" actions menu And "Move right" "link" in the " forum name" "activity" should not be visible And "Move left" "link" in the " forum name" "activity" should be visible Examples: - | format | other | - | Topics | Weekly | - | Weekly | Topics | + | format | prefix | other | + | Custom sections | Sections | Weekly | + | Weekly sections | Weekly | Sections | Scenario Outline: Cancel course indentation reset - Given I navigate to "Plugins > Course formats > format" in site administration + Given I navigate to "Plugins > Course formats > " in site administration And "Reset indentation sitewide" "link" should exist When I click on "Reset indentation sitewide" "link" And I should see "Reset indentation sitewide" @@ -94,20 +94,20 @@ Feature: Reset course indentation And "Cancel" "button" should exist And I click on "Cancel" "button" Then I should not see "Indentation reset." - And I am on " Course 1" course homepage with editing mode on - And I open " forum name" actions menu - And "Move right" "link" in the " forum name" "activity" should not be visible - And "Move left" "link" in the " forum name" "activity" should be visible + And I am on " Course 1" course homepage with editing mode on + And I open " forum name" actions menu + And "Move right" "link" in the " forum name" "activity" should not be visible + And "Move left" "link" in the " forum name" "activity" should be visible And I press the escape key - And I open " database name" actions menu - And "Move right" "link" in the " database name" "activity" should be visible - And "Move left" "link" in the " database name" "activity" should not be visible - And I am on " Course 2" course homepage with editing mode on - And I open " wiki name" actions menu - And "Move right" "link" in the " wiki name" "activity" should not be visible - And "Move left" "link" in the " wiki name" "activity" should be visible + And I open " database name" actions menu + And "Move right" "link" in the " database name" "activity" should be visible + And "Move left" "link" in the " database name" "activity" should not be visible + And I am on " Course 2" course homepage with editing mode on + And I open " wiki name" actions menu + And "Move right" "link" in the " wiki name" "activity" should not be visible + And "Move left" "link" in the " wiki name" "activity" should be visible Examples: - | format | - | Topics | - | Weekly | + | format | prefix | + | Custom sections | Sections | + | Weekly sections | Weekly | diff --git a/admin/tool/admin_presets/tests/behat/apply_presets.feature b/admin/tool/admin_presets/tests/behat/apply_presets.feature index a3a2629d601..de9f87987c8 100644 --- a/admin/tool/admin_presets/tests/behat/apply_presets.feature +++ b/admin/tool/admin_presets/tests/behat/apply_presets.feature @@ -20,7 +20,7 @@ Feature: I can apply presets And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should exist in the "Social format" "table_row" + And "Disable" "icon" should exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration @@ -92,7 +92,7 @@ Feature: I can apply presets And I should see "Server files" in the "Setting changes" "table" And I should see "Show data retention summary" in the "Setting changes" "table" And I should see "Social activities" in the "Setting changes" "table" - And I should see "Social format" in the "Setting changes" "table" + And I should see "Social" in the "Setting changes" "table" And I should see "Starred courses" in the "Setting changes" "table" And I should see "Survey" in the "Setting changes" "table" And I should see "Tags" in the "Setting changes" "table" @@ -115,7 +115,7 @@ Feature: I can apply presets And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should not exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should not exist in the "Social format" "table_row" + And "Disable" "icon" should not exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration diff --git a/admin/tool/admin_presets/tests/behat/revert_changes.feature b/admin/tool/admin_presets/tests/behat/revert_changes.feature index 26f9fa0768c..1e51e01a6c3 100644 --- a/admin/tool/admin_presets/tests/behat/revert_changes.feature +++ b/admin/tool/admin_presets/tests/behat/revert_changes.feature @@ -26,7 +26,7 @@ Feature: I can revert changes after a load And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should not exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should not exist in the "Social format" "table_row" + And "Disable" "icon" should not exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should not exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration @@ -45,7 +45,7 @@ Feature: I can revert changes after a load And I navigate to "Plugins > Blocks > Manage blocks" in site administration And "Disable Logged in user" "icon" should exist in the "Logged in user" "table_row" And I navigate to "Plugins > Course formats > Manage course formats" in site administration - And "Disable" "icon" should exist in the "Social format" "table_row" + And "Disable" "icon" should exist in the "Social" "table_row" And I navigate to "Plugins > Question behaviours > Manage question behaviours" in site administration And "Enabled" "icon" should exist in the "Immediate feedback with CBM" "table_row" And I navigate to "Plugins > Question types > Manage question types" in site administration diff --git a/admin/tool/usertours/tests/behat/tour_filter.feature b/admin/tool/usertours/tests/behat/tour_filter.feature index b4b8514a2a4..0ec7d15944b 100644 --- a/admin/tool/usertours/tests/behat/tour_filter.feature +++ b/admin/tool/usertours/tests/behat/tour_filter.feature @@ -98,7 +98,7 @@ Feature: Apply tour filters to a tour | Description | My first tour | | Apply to URL match | /course/view.php% | | Tour is enabled | 1 | - | Course format | Weekly format | + | Course format | Weekly sections | And I add steps to the "First tour" tour: | targettype | Title | id_content | Content type | | Display in middle of page | Welcome | Welcome to your course tour. | Manual | diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index 15628289139..17dadcc4176 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -45,7 +45,7 @@ Feature: Restore Moodle 2 course backups And I should not see "Topic 16" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Topics format" + And the field "id_format" matches value "Custom sections" And I press "Cancel" @javascript @@ -86,26 +86,26 @@ Feature: Restore Moodle 2 course backups And I should see "Test forum name" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Topics format" + And the field "id_format" matches value "Custom sections" And I set the following fields to these values: - | id_startdate_day | 1 | - | id_startdate_month | January | - | id_startdate_year | 2020 | - | id_format | Weekly format | - | id_enddate_enabled | 0 | + | id_startdate_day | 1 | + | id_startdate_month | January | + | id_startdate_year | 2020 | + | id_format | Weekly sections | + | id_enddate_enabled | 0 | And I press "Save and display" And I should see "1 January - 7 January" And I should see "Test forum name" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Weekly format" + And the field "id_format" matches value "Weekly sections" And I set the following fields to these values: - | id_format | Social format | + | id_format | Social | And I press "Save and display" And I should see "An open forum for chatting about anything you want to" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "id_format" matches value "Social format" + And the field "id_format" matches value "Social" And I press "Cancel" @javascript @@ -118,7 +118,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | Yes | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course layout" matches value "Show one section per page" And the field "Course short name" matches value "C1_1" And I press "Cancel" @@ -140,7 +140,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C2" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" @@ -164,7 +164,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | Yes | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course layout" matches value "Show one section per page" And the field "Course short name" matches value "C1_1" And I press "Cancel" @@ -188,7 +188,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C2" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" @@ -212,7 +212,7 @@ Feature: Restore Moodle 2 course backups | Schema | Overwrite course configuration | No | And I navigate to "Settings" in current page administration And I expand all fieldsets - Then the field "id_format" matches value "Topics format" + Then the field "id_format" matches value "Custom sections" And the field "Course short name" matches value "C4" And the field "Course layout" matches value "Show all sections on one page" And I press "Cancel" diff --git a/course/format/singleactivity/tests/behat/create_course.feature b/course/format/singleactivity/tests/behat/create_course.feature index abce67e9eca..eb81f7cad8f 100644 --- a/course/format/singleactivity/tests/behat/create_course.feature +++ b/course/format/singleactivity/tests/behat/create_course.feature @@ -28,7 +28,7 @@ Feature: Courses can be created in Single Activity mode And I set the following fields to these values: | Course full name | My first course | | Course short name | myfirstcourse | - | Format | Single activity format | + | Format | Single activity | And I press "Update format" Then I should see "Quiz" in the "Type of activity" "field" And I should not see "Forum" in the "Type of activity" "field" diff --git a/course/format/singleactivity/tests/behat/edit_format_course.feature b/course/format/singleactivity/tests/behat/edit_format_course.feature index 15935c9db2f..1372c9f36ba 100644 --- a/course/format/singleactivity/tests/behat/edit_format_course.feature +++ b/course/format/singleactivity/tests/behat/edit_format_course.feature @@ -20,7 +20,7 @@ Feature: Edit format course to Single Activity format And I set the following fields to these values: | Course full name | My first course | | Course short name | myfirstcourse | - | Format | Single activity format | + | Format | Single activity | And I press "Update format" Then I should see "Forum" in the "Type of activity" "field" And I press "Save and display" diff --git a/course/format/tests/base_test.php b/course/format/tests/base_test.php index 6852286d097..f0928dadfd8 100644 --- a/course/format/tests/base_test.php +++ b/course/format/tests/base_test.php @@ -508,14 +508,20 @@ class base_test extends advanced_testcase { * @param string $key the string key * @param string|null $data any string data * @param array|null $expectedstring the expected string (null for exception) + * @param string $courseformat the course format */ - public function test_get_format_string(string $key, ?string $data, ?array $expectedstring) { + public function test_get_format_string( + string $key, + ?string $data, + ?array $expectedstring, + string $courseformat = 'topics' + ): void { global $DB; $this->resetAfterTest(); $generator = $this->getDataGenerator(); - $course = $generator->create_course(['format' => 'topics']); + $course = $generator->create_course(['format' => $courseformat]); if ($expectedstring) { $expected = get_string($expectedstring[0], $expectedstring[1], $expectedstring[2]); @@ -535,9 +541,10 @@ class base_test extends advanced_testcase { public function get_format_string_provider(): array { return [ 'Existing in format lang' => [ - 'key' => 'sectionsdelete', + 'key' => 'addsection', 'data' => null, - 'expectedstring' => ['sectionsdelete', 'format_topics', null], + 'expectedstring' => ['addsection', 'format_weeks', null], + 'courseformat' => 'weeks', ], 'Not existing in format lang' => [ 'key' => 'bulkedit', @@ -545,9 +552,9 @@ class base_test extends advanced_testcase { 'expectedstring' => ['bulkedit', 'core_courseformat', null], ], 'Existing in format lang with data' => [ - 'key' => 'selectsection', + 'key' => 'section_highlight_feedback', 'data' => 'Example', - 'expectedstring' => ['selectsection', 'format_topics', 'Example'], + 'expectedstring' => ['section_highlight_feedback', 'format_topics', 'Example'], ], 'Not existing in format lang with data' => [ 'key' => 'bulkselection', diff --git a/course/format/tests/behat/bulk_section_actions.feature b/course/format/tests/behat/bulk_section_actions.feature index adda2bf9822..1ff9c1cc60f 100644 --- a/course/format/tests/behat/bulk_section_actions.feature +++ b/course/format/tests/behat/bulk_section_actions.feature @@ -38,12 +38,12 @@ Feature: Bulk course section actions. And I should not see "Hidden from students" in the "Topic 2" "section" And I should not see "Hidden from students" in the "Topic 3" "section" And I should not see "Hidden from students" in the "Topic 4" "section" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Activity sample 3" "activity" @@ -55,11 +55,11 @@ Feature: Bulk course section actions. And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk show sections - Given I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + Given I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -68,12 +68,12 @@ Feature: Bulk course section actions. And I should not see "Hidden from students" in the "Topic 2" "section" And I should see "Hidden from students" in the "Topic 3" "section" And I should not see "Hidden from students" in the "Topic 4" "section" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Show on course page" "radio" in the "Topics availability" "dialogue" - And I click on "Apply" "button" in the "Topics availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Show on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -92,11 +92,11 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected topics?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -116,10 +116,10 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Select topic Topic 4" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Select section Topic 4" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" + When I click on "Delete sections" "button" in the "sticky-footer" "region" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -139,11 +139,11 @@ Feature: Bulk course section actions. And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Topic 3" "checkbox" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Topic 3" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected topics?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should not see "Topic 3" in the "region-main" "region" @@ -155,14 +155,14 @@ Feature: Bulk course section actions. And I should not see "Activity sample 4" in the "Topic 2" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move topics after general section - Given I set the field "Edit topic name" in the "Topic 2" "section" to "Move one" - And I set the field "Edit topic name" in the "Topic 3" "section" to "Move two" - And I click on "Select topic Move one" "checkbox" - And I click on "Select topic Move two" "checkbox" + Scenario: Bulk move sections after general section + Given I set the field "Edit section name" in the "Topic 2" "section" to "Move one" + And I set the field "Edit section name" in the "Topic 3" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 3" "section" And I should see "Activity sample 2" in the "Topic 3" "section" @@ -174,13 +174,13 @@ Feature: Bulk course section actions. And "Topic 3" "section" should appear after "Move two" "section" And "Topic 4" "section" should appear after "Topic 3" "section" - Scenario: Bulk move topics at the end of the course - Given I set the field "Edit topic name" in the "Topic 3" "section" to "Move me" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Move me" "checkbox" + Scenario: Bulk move sections at the end of the course + Given I set the field "Edit section name" in the "Topic 3" "section" to "Move me" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "Topic 4" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "Topic 4" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 1" "section" And I should see "Activity sample 2" in the "Topic 1" "section" @@ -192,13 +192,13 @@ Feature: Bulk course section actions. And "Topic 3" "section" should appear after "Topic 2" "section" And "Move me" "section" should appear after "Topic 3" "section" - Scenario: Bulk move topics in the middle of the course - Given I set the field "Edit topic name" in the "Topic 4" "section" to "Move me" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Move me" "checkbox" + Scenario: Bulk move sections in the middle of the course + Given I set the field "Edit section name" in the "Topic 4" "section" to "Move me" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "Topic 2" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "Topic 2" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 2" "section" And I should see "Activity sample 2" in the "Topic 2" "section" diff --git a/course/format/tests/behat/bulk_select.feature b/course/format/tests/behat/bulk_select.feature index d2f69f483cd..bdc631d4ae1 100644 --- a/course/format/tests/behat/bulk_select.feature +++ b/course/format/tests/behat/bulk_select.feature @@ -28,7 +28,7 @@ Feature: Bulk activity and section selection. Scenario: Enable and disable bulk editing When I click on "Bulk actions" "button" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" + And the focused element is "Select section Topic 1" "checkbox" And I click on "Close bulk actions" "button" in the "sticky-footer" "region" And "sticky-footer" "region" should not be visible And the focused element is "Bulk actions" "button" @@ -38,12 +38,12 @@ Feature: Bulk activity and section selection. And I should see "0 selected" in the "sticky-footer" "region" When I click on "Select activity Activity sample 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - Then the "Select topic Topic 1" "checkbox" should be disabled + Then the "Select section Topic 1" "checkbox" should be disabled Scenario: Selecting sections disable activity selection Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" + When I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" Then the "Select activity Activity sample 1" "checkbox" should be disabled @@ -74,7 +74,7 @@ Feature: Bulk activity and section selection. Scenario: Select all is disabled until a section is selected Given I click on "Bulk actions" "button" And the "Select all" "checkbox" should be disabled - When I click on "Select topic Topic 1" "checkbox" + When I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" Then the "Select all" "checkbox" should be enabled @@ -96,35 +96,35 @@ Feature: Bulk activity and section selection. Scenario: Select all when a section is selected will select all sections Given I click on "Bulk actions" "button" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "4 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "1" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "1" Scenario: Click on a select all with all sections selected unselects all sections Given I click on "Bulk actions" "button" - And I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" - And I click on "Select topic Topic 3" "checkbox" - And I click on "Select topic Topic 4" "checkbox" + And I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" + And I click on "Select section Topic 3" "checkbox" + And I click on "Select section Topic 4" "checkbox" And I should see "4 selected" in the "sticky-footer" "region" And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" - And the field "Select topic Topic 1" matches value "" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" + And the focused element is "Select section Topic 1" "checkbox" + And the field "Select section Topic 1" matches value "" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" Scenario: Click on a select all with all activity selected unselects all activities Given I click on "Bulk actions" "button" @@ -136,7 +136,7 @@ Feature: Bulk activity and section selection. And the "Select all" "checkbox" should be enabled When I click on "Select all" "checkbox" in the "sticky-footer" "region" Then I should see "0 selected" in the "sticky-footer" "region" - And the focused element is "Select topic Topic 1" "checkbox" + And the focused element is "Select section Topic 1" "checkbox" And the field "Activity sample 1" matches value "" And the field "Activity sample 2" matches value "" And the field "Activity sample 3" matches value "" @@ -191,31 +191,31 @@ Feature: Bulk activity and section selection. Scenario: Select a range of sections using shift Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" - And I shift click on "Select topic Topic 3" "checkbox" in the "page" "region" + When I click on "Select section Topic 1" "checkbox" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" + And I shift click on "Select section Topic 3" "checkbox" in the "page" "region" Then I should see "3 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "" Scenario: Select all section with alt click Given I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "" - And the field "Select topic Topic 2" matches value "" - And the field "Select topic Topic 3" matches value "" - And the field "Select topic Topic 4" matches value "" - When I alt click on "Select topic Topic 3" "checkbox" in the "page" "region" + And the field "Select section Topic 1" matches value "" + And the field "Select section Topic 2" matches value "" + And the field "Select section Topic 3" matches value "" + And the field "Select section Topic 4" matches value "" + When I alt click on "Select section Topic 3" "checkbox" in the "page" "region" And I should see "4 selected" in the "sticky-footer" "region" - And the field "Select topic Topic 1" matches value "1" - And the field "Select topic Topic 2" matches value "1" - And the field "Select topic Topic 3" matches value "1" - And the field "Select topic Topic 4" matches value "1" + And the field "Select section Topic 1" matches value "1" + And the field "Select section Topic 2" matches value "1" + And the field "Select section Topic 3" matches value "1" + And the field "Select section Topic 4" matches value "1" Scenario: Bulk section selection is available also in one section per page Given I navigate to "Settings" in current page administration @@ -224,6 +224,6 @@ Feature: Bulk activity and section selection. And I click on "Save and display" "button" And I click on "Bulk actions" "button" And I should see "0 selected" in the "sticky-footer" "region" - When I click on "Select topic Topic 1" "checkbox" - And I click on "Select topic Topic 2" "checkbox" + When I click on "Select section Topic 1" "checkbox" + And I click on "Select section Topic 2" "checkbox" Then I should see "2 selected" in the "sticky-footer" "region" diff --git a/course/format/tests/behat/bulk_show_one_section_actions.feature b/course/format/tests/behat/bulk_show_one_section_actions.feature index ad9facee5c7..04309a5e5f9 100644 --- a/course/format/tests/behat/bulk_show_one_section_actions.feature +++ b/course/format/tests/behat/bulk_show_one_section_actions.feature @@ -31,25 +31,25 @@ Feature: Bulk course section actions one section per page And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk section edit is only available when multiple sections are displayed - Given I click on "Select topic Topic 1" "checkbox" + Given I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" And I click on "Close bulk actions" "button" in the "sticky-footer" "region" # Move to single topic page. And I open section "1" edit menu When I click on "View" "link" in the "Topic 1" "section" And I click on "Bulk actions" "button" - Then "Select topic Topic 1" "checkbox" should not exist + Then "Select section Topic 1" "checkbox" should not exist Scenario: Bulk availability sections in one section per page Given I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Topic 1" "section" And I should not see "Hidden from students" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - And I click on "Topics availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Topic availability" "dialogue" - When I click on "Apply" "button" in the "Topic availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Section availability" "dialogue" + When I click on "Apply" "button" in the "Section availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Topic 1" "section" @@ -65,10 +65,10 @@ Feature: Bulk course section actions one section per page And I should see "Activity sample 2" in the "Topic 1" "section" And I should see "Activity sample 3" in the "Topic 2" "section" And I should see "Activity sample 4" in the "Topic 2" "section" - And I click on "Select topic Topic 1" "checkbox" + And I click on "Select section Topic 1" "checkbox" And I should see "1 selected" in the "sticky-footer" "region" - When I click on "Delete topics" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete topic?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete section?" "dialogue" Then I should see "Topic 1" in the "region-main" "region" And I should see "Topic 2" in the "region-main" "region" And I should see "Topic 3" in the "region-main" "region" @@ -79,14 +79,14 @@ Feature: Bulk course section actions one section per page And I should see "Activity sample 4" in the "Topic 1" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move topics in one section per page - Given I set the field "Edit topic name" in the "Topic 2" "section" to "Move one" - And I set the field "Edit topic name" in the "Topic 3" "section" to "Move two" - And I click on "Select topic Move one" "checkbox" - And I click on "Select topic Move two" "checkbox" + Scenario: Bulk move sections in one section per page + Given I set the field "Edit section name" in the "Topic 2" "section" to "Move one" + And I set the field "Edit section name" in the "Topic 3" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move topics" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected topics" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the topics. Then I should see "Activity sample 1" in the "Topic 3" "section" And I should see "Activity sample 2" in the "Topic 3" "section" diff --git a/course/format/tests/behat/course_courseindex.feature b/course/format/tests/behat/course_courseindex.feature index d45931f5f9e..9aee7ea6444 100644 --- a/course/format/tests/behat/course_courseindex.feature +++ b/course/format/tests/behat/course_courseindex.feature @@ -257,7 +257,7 @@ Feature: Course index depending on role Scenario: Adding section should alter the course index Given I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - When I click on "Add topic" "link" in the "Topic 4" "section" + When I click on "Add section" "link" in the "Topic 4" "section" Then I should see "Topic 5" in the "courseindex-content" "region" @javascript diff --git a/course/format/tests/behat/course_manageactivities.feature b/course/format/tests/behat/course_manageactivities.feature index 1833a123e1f..9645769a1eb 100644 --- a/course/format/tests/behat/course_manageactivities.feature +++ b/course/format/tests/behat/course_manageactivities.feature @@ -40,7 +40,7 @@ Feature: Verify edit utils availability And I should see "Edit settings" And ".section_action_menu" "css_element" should exist in the "Topic 1" "section" And I click on ".section_action_menu" "css_element" in the "Topic 1" "section" - And I should see "Edit topic" + And I should see "Edit settings" @javascript Scenario: Edit mode should not be available to students. @@ -54,7 +54,7 @@ Feature: Verify edit utils availability When I am on "Course 1" course homepage And I turn editing mode on Then I should see "Add an activity or resource" - But I should not see "Add topic" + But I should not see "Add section" And I open "Activity sample 1" actions menu And I should see "Edit settings" And I open section "1" edit menu @@ -70,9 +70,9 @@ Feature: Verify edit utils availability When I am on "Course 1" course homepage And I turn editing mode on Then I should see "Add an activity or resource" - And I should see "Add topic" + And I should see "Add section" And I open "Activity sample 1" actions menu And I should see "Edit settings" And ".section_action_menu" "css_element" should exist in the "Topic 1" "section" And I click on ".section_action_menu" "css_element" in the "Topic 1" "section" - And I should see "Edit topic" + And I should see "Edit settings" diff --git a/course/format/tests/behat/duplicate_section.feature b/course/format/tests/behat/duplicate_section.feature index bbf2926e678..aff40ccea60 100644 --- a/course/format/tests/behat/duplicate_section.feature +++ b/course/format/tests/behat/duplicate_section.feature @@ -27,7 +27,7 @@ Feature: Duplicate a section @javascript Scenario: Duplicate a named section - Given I set the field "Edit topic name" in the "Topic 1" "section" to "New name" + Given I set the field "Edit section name" in the "Topic 1" "section" to "New name" And I should see "New name" in the "New name" "section" When I open section "1" edit menu And I click on "Duplicate" "link" in the "New name" "section" diff --git a/course/format/topics/tests/behat/edit_delete_sections.feature b/course/format/topics/tests/behat/edit_delete_sections.feature index e556c85f52f..c3ff0a5db3c 100644 --- a/course/format/topics/tests/behat/edit_delete_sections.feature +++ b/course/format/topics/tests/behat/edit_delete_sections.feature @@ -1,8 +1,8 @@ @format @format_topics -Feature: Sections can be edited and deleted in topics format +Feature: Sections can be edited and deleted in custom sections format In order to rearrange my course contents As a teacher - I need to edit and Delete topics + I need to edit and delete sections Background: Given the following "users" exist: @@ -23,29 +23,29 @@ Feature: Sections can be edited and deleted in topics format And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - Scenario: View the default name of the general section in topics format + Scenario: View the default name of the general section in custom sections format When I edit the section "0" Then the field "Custom" matches value "0" And the field "New value for Section name" matches value "General" - Scenario: Edit the default name of the general section in topics format + Scenario: Edit the default name of the general section in custom sections format Given I should see "General" in the "General" "section" When I edit the section "0" and I fill the form with: | Custom | 1 | | New value for Section name | This is the general section | Then I should see "This is the general section" in the "This is the general section" "section" - Scenario: View the default name of the second section in topics format + Scenario: View the default name of the second section in custom sections format When I edit the section "2" Then the field "Custom" matches value "0" And the field "New value for Section name" matches value "Topic 2" - Scenario: Edit section summary in topics format + Scenario: Edit section summary in custom sections format When I edit the section "2" and I fill the form with: - | Summary | Welcome to section 2 | + | Description | Welcome to section 2 | Then I should see "Welcome to section 2" in the "Topic 2" "section" - Scenario: Edit section default name in topics format + Scenario: Edit section default name in custom sections format When I edit the section "2" and I fill the form with: | Custom | 1 | | New value for Section name | This is the second topic | @@ -53,23 +53,23 @@ Feature: Sections can be edited and deleted in topics format And I should not see "Topic 2" in the "region-main" "region" @javascript - Scenario: Inline edit section name in topics format - When I set the field "Edit topic name" in the "Topic 1" "section" to "Midterm evaluation" + Scenario: Inline edit section name in custom sections format + When I set the field "Edit section name" in the "Topic 1" "section" to "Midterm evaluation" Then I should not see "Topic 1" in the "region-main" "region" - And "New name for topic" "field" should not exist + And "New name for section" "field" should not exist And I should see "Midterm evaluation" in the "Midterm evaluation" "section" And I am on "Course 1" course homepage And I should not see "Topic 1" in the "region-main" "region" And I should see "Midterm evaluation" in the "Midterm evaluation" "section" - Scenario: Deleting the last section in topics format + Scenario: Deleting the last section in custom sections format When I delete section "5" Then I should see "Are you absolutely sure you want to completely delete \"Topic 5\" and all the activities it contains?" And I press "Delete" And I should not see "Topic 5" And I should see "Topic 4" - Scenario: Deleting the middle section in topics format + Scenario: Deleting the middle section in custom sections format When I delete section "4" And I press "Delete" Then I should not see "Topic 5" @@ -78,21 +78,21 @@ Feature: Sections can be edited and deleted in topics format And I should see "Topic 4" @javascript - Scenario: Adding sections at the end of a topics format - When I click on "Add topic" "link" in the "Topic 5" "section" + Scenario: Adding sections at the end of a custom sections format + When I click on "Add section" "link" in the "Topic 5" "section" Then I should see "Topic 6" in the "Topic 6" "section" And I should see "Test choice name" in the "Topic 5" "section" @javascript - Scenario: Adding sections between topics in topics format - When I click on "Add topic" "link" in the "Topic 4" "section" + Scenario: Adding sections between topics in custom sections format + When I click on "Add section" "link" in the "Topic 4" "section" Then I should see "Topic 6" in the "Topic 6" "section" And I should not see "Test choice name" in the "Topic 5" "section" And I should see "Test choice name" in the "Topic 6" "section" @javascript Scenario: Add a topic and then add an activity in it - When I click on "Add topic" "link" in the "Topic 5" "section" + When I click on "Add section" "link" in the "Topic 5" "section" And I add a "Assignment" to section "6" and I fill the form with: | Assignment name | Very new activity | | Description | Test | diff --git a/course/format/topics/tests/behat/highlight_sections.feature b/course/format/topics/tests/behat/highlight_sections.feature index a520be353ef..ba51c0f52e3 100644 --- a/course/format/topics/tests/behat/highlight_sections.feature +++ b/course/format/topics/tests/behat/highlight_sections.feature @@ -45,5 +45,5 @@ Feature: Sections can be highlighted And I click on "Highlight" "link" in the "Topic 3" "section" And I should see "Highlighted" in the "Topic 3" "section" When I open section "3" edit menu - And I click on "Remove highlight" "link" in the "Topic 3" "section" + And I click on "Unhighlight" "link" in the "Topic 3" "section" Then I should not see "Highlighted" in the "Topic 3" "section" diff --git a/course/format/weeks/tests/behat/bulk_actions.feature b/course/format/weeks/tests/behat/bulk_actions.feature index 5136e4249ca..111b76d8368 100644 --- a/course/format/weeks/tests/behat/bulk_actions.feature +++ b/course/format/weeks/tests/behat/bulk_actions.feature @@ -38,12 +38,12 @@ Feature: Weeks format bulk activity actions. And I should not see "Hidden from students" in the "8 May - 14 May" "section" And I should not see "Hidden from students" in the "15 May - 21 May" "section" And I should not see "Hidden from students" in the "22 May - 28 May" "section" - When I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + When I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should see "Hidden from students" in the "Activity sample 3" "activity" @@ -55,11 +55,11 @@ Feature: Weeks format bulk activity actions. And I should see "0 selected" in the "sticky-footer" "region" Scenario: Bulk show weeks - Given I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 15 May - 21 May" "checkbox" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Hide on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + Given I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 15 May - 21 May" "checkbox" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Hide on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" And I should see "Hidden from students" in the "Activity sample 1" "activity" And I should see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -68,12 +68,12 @@ Feature: Weeks format bulk activity actions. And I should not see "Hidden from students" in the "8 May - 14 May" "section" And I should see "Hidden from students" in the "15 May - 21 May" "section" And I should not see "Hidden from students" in the "22 May - 28 May" "section" - When I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + When I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - And I click on "Weeks availability" "button" in the "sticky-footer" "region" - And I click on "Show on course page" "radio" in the "Weeks availability" "dialogue" - And I click on "Apply" "button" in the "Weeks availability" "dialogue" + And I click on "Sections availability" "button" in the "sticky-footer" "region" + And I click on "Show on course page" "radio" in the "Sections availability" "dialogue" + And I click on "Apply" "button" in the "Sections availability" "dialogue" Then I should not see "Hidden from students" in the "Activity sample 1" "activity" And I should not see "Hidden from students" in the "Activity sample 2" "activity" And I should not see "Hidden from students" in the "Activity sample 3" "activity" @@ -92,11 +92,11 @@ Feature: Weeks format bulk activity actions. And I should see "Activity sample 2" in the "1 May - 7 May" "section" And I should see "Activity sample 3" in the "8 May - 14 May" "section" And I should see "Activity sample 4" in the "8 May - 14 May" "section" - And I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week 8 May - 14 May" "checkbox" + And I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete weeks" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected weeks?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "1 May - 7 May" in the "region-main" "region" And I should see "8 May - 14 May" in the "region-main" "region" And I should not see "15 May - 21 May" in the "region-main" "region" @@ -116,11 +116,11 @@ Feature: Weeks format bulk activity actions. And I should see "Activity sample 2" in the "1 May - 7 May" "section" And I should see "Activity sample 3" in the "8 May - 14 May" "section" And I should see "Activity sample 4" in the "8 May - 14 May" "section" - And I click on "Select week 8 May - 14 May" "checkbox" - And I click on "Select week 15 May - 21 May" "checkbox" + And I click on "Select section 8 May - 14 May" "checkbox" + And I click on "Select section 15 May - 21 May" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Delete weeks" "button" in the "sticky-footer" "region" - And I click on "Delete" "button" in the "Delete selected weeks?" "dialogue" + When I click on "Delete sections" "button" in the "sticky-footer" "region" + And I click on "Delete" "button" in the "Delete selected sections?" "dialogue" Then I should see "1 May - 7 May" in the "region-main" "region" And I should see "8 May - 14 May" in the "region-main" "region" And I should not see "15 May - 21 May" in the "region-main" "region" @@ -132,14 +132,14 @@ Feature: Weeks format bulk activity actions. And I should not see "Activity sample 4" in the "8 May - 14 May" "section" And I should see "0 selected" in the "sticky-footer" "region" - Scenario: Bulk move weeks after general section - Given I set the field "Edit week name" in the "8 May - 14 May" "section" to "Move one" - And I set the field "Edit week name" in the "15 May - 21 May" "section" to "Move two" - And I click on "Select week Move one" "checkbox" - And I click on "Select week Move two" "checkbox" + Scenario: Bulk move sections after general section + Given I set the field "Edit section name" in the "8 May - 14 May" "section" to "Move one" + And I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move two" + And I click on "Select section Move one" "checkbox" + And I click on "Select section Move two" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "General" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "General" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "15 May - 21 May" "section" And I should see "Activity sample 2" in the "15 May - 21 May" "section" @@ -151,13 +151,13 @@ Feature: Weeks format bulk activity actions. And "15 May - 21 May" "section" should appear after "Move two" "section" And "22 May - 28 May" "section" should appear after "15 May - 21 May" "section" - Scenario: Bulk move weeks at the end of the course - Given I set the field "Edit week name" in the "15 May - 21 May" "section" to "Move me" - And I click on "Select week 8 May - 14 May" "checkbox" - And I click on "Select week Move me" "checkbox" + Scenario: Bulk move sections at the end of the course + Given I set the field "Edit section name" in the "15 May - 21 May" "section" to "Move me" + And I click on "Select section 8 May - 14 May" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "22 May - 28 May" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "22 May - 28 May" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "1 May - 7 May" "section" And I should see "Activity sample 2" in the "1 May - 7 May" "section" @@ -169,13 +169,13 @@ Feature: Weeks format bulk activity actions. And "15 May - 21 May" "section" should appear after "8 May - 14 May" "section" And "Move me" "section" should appear after "15 May - 21 May" "section" - Scenario: Bulk move weeks in the middle of the course - Given I set the field "Edit week name" in the "22 May - 28 May" "section" to "Move me" - And I click on "Select week 1 May - 7 May" "checkbox" - And I click on "Select week Move me" "checkbox" + Scenario: Bulk move sections in the middle of the course + Given I set the field "Edit section name" in the "22 May - 28 May" "section" to "Move me" + And I click on "Select section 1 May - 7 May" "checkbox" + And I click on "Select section Move me" "checkbox" And I should see "2 selected" in the "sticky-footer" "region" - When I click on "Move weeks" "button" in the "sticky-footer" "region" - And I click on "8 May - 14 May" "link" in the "Move selected weeks" "dialogue" + When I click on "Move sections" "button" in the "sticky-footer" "region" + And I click on "8 May - 14 May" "link" in the "Move selected sections" "dialogue" # Check activities are moved with the weeks. Then I should see "Activity sample 1" in the "8 May - 14 May" "section" And I should see "Activity sample 2" in the "8 May - 14 May" "section" diff --git a/course/format/weeks/tests/behat/current_week.feature b/course/format/weeks/tests/behat/current_week.feature index ee00821c715..5658c150f3a 100644 --- a/course/format/weeks/tests/behat/current_week.feature +++ b/course/format/weeks/tests/behat/current_week.feature @@ -9,11 +9,11 @@ Feature: The current week should be highlighted in the course. | fullname | shortname | format | coursedisplay | numsections | startdate | | Course 1 | C1 | weeks | 0 | 5 | ##yesterday## | When I am on the "C1" "Course" page logged in as "admin" - Then I should see "This week" in the "#section-1" "css_element" + Then I should see "Current week" in the "#section-1" "css_element" Scenario: Highlight next week Given the following "courses" exist: | fullname | shortname | format | coursedisplay | numsections | startdate | | Course 1 | C1 | weeks | 0 | 5 | ##monday last week## | When I am on the "C1" "Course" page logged in as "admin" - Then I should see "This week" in the "#section-2" "css_element" + Then I should see "Current week" in the "#section-2" "css_element" diff --git a/course/format/weeks/tests/behat/edit_delete_sections.feature b/course/format/weeks/tests/behat/edit_delete_sections.feature index f91d48aec19..fe42db9d08f 100644 --- a/course/format/weeks/tests/behat/edit_delete_sections.feature +++ b/course/format/weeks/tests/behat/edit_delete_sections.feature @@ -1,8 +1,8 @@ @format @format_weeks -Feature: Sections can be edited and deleted in weeks format +Feature: Sections can be edited and deleted in weekly sections format In order to rearrange my course contents As a teacher - I need to edit and Delete weeks + I need to edit and delete sections Background: Given the following "users" exist: @@ -41,7 +41,7 @@ Feature: Sections can be edited and deleted in weeks format Scenario: Edit section summary in weeks format When I edit the section "2" and I fill the form with: - | Summary | Welcome to section 2 | + | Description | Welcome to section 2 | Then I should see "Welcome to section 2" in the "8 May - 14 May" "section" Scenario: Edit section default name in weeks format @@ -54,7 +54,7 @@ Feature: Sections can be edited and deleted in weeks format @javascript Scenario: Inline edit section name in weeks format - When I set the field "Edit week name" in the "1 May - 7 May" "section" to "Midterm evaluation" + When I set the field "Edit section name" in the "1 May - 7 May" "section" to "Midterm evaluation" Then I should not see "1 May - 7 May" in the "region-main" "region" And "New name for week" "field" should not exist And I should see "Midterm evaluation" in the "Midterm evaluation" "section" diff --git a/course/tests/behat/course_category_management_listing.feature b/course/tests/behat/course_category_management_listing.feature index e6ba2dc5a3e..39d24ade4b2 100644 --- a/course/tests/behat/course_category_management_listing.feature +++ b/course/tests/behat/course_category_management_listing.feature @@ -30,7 +30,7 @@ Feature: Course category management interface performs as expected | Cat 1 | 0 | CAT1 | And the following "courses" exist: | fullname | shortname | category | format | - | Course 1 | C1 | CAT1 | topics | + | Course 1 | C1 | CAT1 | topics | And I log in as "admin" And I go to the courses management page @@ -69,7 +69,7 @@ Feature: Course category management interface performs as expected And I should see "Course 1" in the "#course-detail h3" "css_element" And I should see "C1" in the "#course-detail .shortname" "css_element" And I should see "Course 1" in the "#course-detail .fullname" "css_element" - And I should see "Topics" in the "#course-detail .format" "css_element" + And I should see "Custom sections" in the "#course-detail .format" "css_element" And I should see "Cat 1" in the "#course-detail .category" "css_element" Scenario: Test displaying of sub categories diff --git a/course/tests/behat/course_collapse_sections.feature b/course/tests/behat/course_collapse_sections.feature index d8516568237..62b68be063d 100644 --- a/course/tests/behat/course_collapse_sections.feature +++ b/course/tests/behat/course_collapse_sections.feature @@ -43,7 +43,7 @@ Feature: Collapse course sections @javascript Scenario: No chevron on site home - Given the following activity" exists: + Given the following "activity" exists: | activity | forum | | course | Acceptance test site | | section | 1 | @@ -51,14 +51,14 @@ Feature: Collapse course sections And I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" + And I click on "Edit" "link" in the "region-main" "region" And I click on "Custom" "checkbox" And I set the field "New value for Section name" to "New section name" When I press "Save changes" Then "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region" @javascript - Scenario: Expand/collapse sections for Topics format. + Scenario: Expand/collapse sections for Custom sections format. Given I am on the "Course 1" course page logged in as student1 And "[data-toggle=collapse]" "css_element" should exist in the "region-main" "region" And I should see "Assignment 1" in the "region-main" "region" @@ -101,7 +101,7 @@ Feature: Collapse course sections When I navigate to "Settings" in current page administration And I expand all fieldsets And I set the following fields to these values: - | Format | Weekly format | + | Format | Weekly sections | And I press "Save and display" And I should see "Assignment 1" in the "region-main" "region" And I should see "Assignment 2" in the "region-main" "region" @@ -143,7 +143,7 @@ Feature: Collapse course sections And I should see "Forum 5" @javascript - Scenario: Users don't see chevron on one section per page for Topics format + Scenario: Users don't see chevron on one section per page for Custom sections format Given I am on the "Course 1" course page logged in as teacher1 When I navigate to "Settings" in current page administration And I expand all fieldsets @@ -170,7 +170,7 @@ Feature: Collapse course sections And I expand all fieldsets And I set the following fields to these values: | Course layout | Show one section per page | - | Format | Weekly format | + | Format | Weekly sections | And I press "Save and display" And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region" And I click on "8 May - 14 May" "link" in the "region-main" "region" diff --git a/course/tests/behat/course_format.feature b/course/tests/behat/course_format.feature index bb3d2c28da6..7045dc5385d 100644 --- a/course/tests/behat/course_format.feature +++ b/course/tests/behat/course_format.feature @@ -9,7 +9,7 @@ Feature: Teacher can change the course format Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - # Course format is initially set to Topics format + # Course format is initially set to Custom sections format And the following "courses" exist: | fullname | shortname | format | startdate | | Course 1 | C1 | topics | ## 1 day ago ## | @@ -21,7 +21,7 @@ Feature: Teacher can change the course format Then I should see "Topic 1" And I am on the "Course 1" "course editing" page And I expand all fieldsets - # Fields that appear for Topics format exist + # Fields that appear for Custom sections format exist # Also confirm contents of Hidden sections and Course layout select box And I should see "Hidden sections" And the "Hidden sections" select box should contain "Hidden sections are shown as not available" @@ -34,7 +34,7 @@ Feature: Teacher can change the course format # Course layout default value is 0 (Show all sections on one page) And the field "Course layout" matches value "0" # Set course format to Single activity format - And I set the field "Format" to "Single activity format" + And I set the field "Format" to "Single activity" And I expand all fieldsets # Confirm that fields that appear for Single activity format appears And I should see "Type of activity" @@ -47,10 +47,10 @@ Feature: Teacher can change the course format And I should not see "Topic 1" And I am on the "Course 1" "course editing" page And I expand all fieldsets - # Set course format to Weekly format - And I set the field "Format" to "Weekly format" + # Set course format. + And I set the field "Format" to "Weekly sections" And I expand all fieldsets - # Confirm that fields that appear for Weekly format appears + # Confirm that fields that appear for Weekly sections format appears # Also confirm contents of Hidden sections and Course layout select box And I should see "Hidden sections" And the "Hidden sections" select box should contain "Hidden sections are shown as not available" @@ -64,12 +64,12 @@ Feature: Teacher can change the course format And the field "Course layout" matches value "0" And I press "Save and display" # Confirm that course page displays weekly sections - And I should see "This week" + And I should see "Current week" And I should not see "Browse the glossary using this index" And I am on the "Course 1" "course editing" page And I expand all fieldsets # Set course format to Social format - And I set the field "Format" to "Social format" + And I set the field "Format" to "Social" # Confirm that fields that appear for Social format appears And I expand all fieldsets And I should see "Number of discussions" @@ -77,4 +77,4 @@ Feature: Teacher can change the course format And I press "Save and display" # Confirm that course page displays a forum And I should see "There are no discussion topics yet in this forum" - And I should not see "This week" + And I should not see "Current week" diff --git a/course/tests/behat/frontpage_topic_section.feature b/course/tests/behat/frontpage_topic_section.feature index 7ea81a57a3d..e5619279748 100644 --- a/course/tests/behat/frontpage_topic_section.feature +++ b/course/tests/behat/frontpage_topic_section.feature @@ -24,7 +24,7 @@ Feature: Site home topic section And I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" + And I click on "Edit" "link" in the "region-main" "region" And I click on "Custom" "checkbox" And I set the field "New value for Section name" to "New section name" When I press "Save changes" @@ -37,8 +37,8 @@ Feature: Site home topic section Given I log in as "admin" And I am on site homepage And I turn editing mode on - And I click on "Edit summary" "link" in the "region-main" "region" - And I set the field "Summary" to "New section description" + And I click on "Edit" "link" in the "region-main" "region" + And I set the field "Description" to "New section description" When I press "Save changes" And I should see "New section description" in the "region-main" "region" Then I turn editing mode off diff --git a/course/tests/behat/max_number_sections.feature b/course/tests/behat/max_number_sections.feature index 5fa0c04c6ce..e556f0efe7e 100644 --- a/course/tests/behat/max_number_sections.feature +++ b/course/tests/behat/max_number_sections.feature @@ -26,7 +26,7 @@ Feature: The maximum number of weeks/topics in a course can be configured | Course full name | New course fullname | | Course short name | New course shortname | | Number of sections | 90 | - | Format | Topics format | + | Format | Custom sections | And I should see "Topic 90" @javascript @@ -42,5 +42,5 @@ Feature: The maximum number of weeks/topics in a course can be configured | Course full name | New course fullname | | Course short name | New course shortname | | Number of sections | 0 | - | Format | Topics format | + | Format | Custom sections | And I should not see "Topic 1" diff --git a/course/tests/behat/section_highlighting.feature b/course/tests/behat/section_highlighting.feature index 07b54235bf5..fd2a39924dd 100644 --- a/course/tests/behat/section_highlighting.feature +++ b/course/tests/behat/section_highlighting.feature @@ -5,7 +5,7 @@ Feature: Topic's course sections highlighting I need to highlight one specific section @javascript - Scenario Outline: Highlight a topic's course section with course paged mode and without it + Scenario Outline: Highlight a course section with course paged mode and without it Given the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | diff --git a/course/tests/behat/sectionzero_title.feature b/course/tests/behat/sectionzero_title.feature index d3599dba3a4..41e322b77a0 100644 --- a/course/tests/behat/sectionzero_title.feature +++ b/course/tests/behat/sectionzero_title.feature @@ -32,11 +32,11 @@ Feature: Section 0 default/custom title | Custom | 1 | | New value for Section name | Edited section 0 | And I should see "Edited section 0" in the "li#section-0" "css_element" - When I set the field "Edit topic name" in the "li#section-0" "css_element" to "" + When I set the field "Edit section name" in the "li#section-0" "css_element" to "" Then I should not see "Edited section 0" in the "li#section-0" "css_element" And I should see "General" in the "li#section-0" "css_element" - And "New name for topic" "field" should not exist - And I set the field "Edit topic name" in the "li#section-0" "css_element" to "Edited section 0" + And "New name for section" "field" should not exist + And I set the field "Edit section name" in the "li#section-0" "css_element" to "Edited section 0" And I should see "Edited section 0" in the "li#section-0" "css_element" And I edit the section "0" and I fill the form with: | Custom | 0 | diff --git a/course/tests/reportbuilder/datasource/courses_test.php b/course/tests/reportbuilder/datasource/courses_test.php index 824436f6e0b..39455f303c5 100644 --- a/course/tests/reportbuilder/datasource/courses_test.php +++ b/course/tests/reportbuilder/datasource/courses_test.php @@ -155,7 +155,7 @@ class courses_test extends core_reportbuilder_testcase { $this->assertStringContainsString($course->shortname, $courserow[5]); $this->assertStringContainsString($course->idnumber, $courserow[6]); $this->assertEquals(format_text($course->summary, $course->summaryformat), $courserow[7]); - $this->assertEquals('Topics format', $courserow[8]); + $this->assertEquals('Custom sections', $courserow[8]); $this->assertEquals(userdate($course->startdate), $courserow[9]); $this->assertEmpty($courserow[10]); $this->assertEquals('Yes', $courserow[11]); -- 2.11.4.GIT