Merge branch 'MDL-80460-main' of https://github.com/sarjona/moodle

This commit is contained in:
Ilya Tregubov
2024-03-07 08:41:42 +08:00
52 changed files with 862 additions and 680 deletions
@@ -101,7 +101,7 @@ Feature: Set up contextual data for tests
| user | course | role |
| student1 | C1 | student |
When I am on the "Course 1" course page logged in as student1
Then I should see "Topic 1"
Then I should see "New section"
Scenario: Add role assigns
Given the following "roles" exist:
@@ -12,8 +12,8 @@ Feature: Create testing scenarios using generators
And I press "Import"
And I should see "Scenario: Create course content"
Then I am on the "C1" "Course" page
And I should see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 2" in the "Topic 1" "section"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I navigate to course participants
And I should see "Teacher Test1"
And I should see "Student Test1"
@@ -5,6 +5,7 @@ Feature: Prepare scenario for testing
| shortname | C1 |
| category | 0 |
| numsections | 3 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | visible |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 | 1 |
@@ -11,9 +11,9 @@ Feature: Basic recycle bin functionality
| student1 | Student | 1 | student@asd.com |
| student2 | Student | 2 | student2@asd.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
| fullname | shortname | initsections |
| Course 1 | C1 | 1 |
| Course 2 | C2 | 0 |
And the following "activities" exist:
| activity | course | section | name | intro |
| assign | C1 | 1 | Test assign 1 | Test 1 |
@@ -56,7 +56,7 @@ Feature: Basic recycle bin functionality
And I should see "'Test assign 1' has been restored"
And I wait to be redirected
And I am on "Course 1" course homepage
And I should see "Test assign 1" in the "Topic 1" "section"
And I should see "Test assign 1" in the "Section 1" "section"
@javascript
Scenario: Restore a deleted course
@@ -1,5 +1,5 @@
@core @core_availability
Feature: display_availability
Feature: Display availability for activities and sections
In order to know which activities are available
As a user
I need to see appropriate availability restrictions for activities and sections
@@ -23,9 +23,11 @@ Feature: display_availability
# and for each condition type.)
Background:
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| initsections | 1 |
And the following "users" exist:
| username |
| teacher1 |
@@ -93,17 +95,17 @@ Feature: display_availability
# Page 1 display still there but should not be a link.
Then I should see "Page 1" in the "#section-1" "css_element"
And ".activity-instance a" "css_element" should not exist in the "Topic 1" "section"
And ".activity-instance a" "css_element" should not exist in the "Section 1" "section"
# Date display should be present.
And I should see "Available until" in the "Topic 1" "section"
And I should see "Available until" in the "Section 1" "section"
# Page 2 display not there at all
And I should not see "Page 2" in the "region-main" "region"
# Page 3 display and link
And I should see "Page 3" in the "region-main" "region"
And ".activity-instance a" "css_element" should exist in the "Topic 3" "section"
And ".activity-instance a" "css_element" should exist in the "Section 3" "section"
@javascript
Scenario: Section availability display
@@ -153,7 +155,7 @@ Feature: display_availability
And I should see "Page 3" in the "region-main" "region"
# Section 1 should be visible and show info.
And I should see "Topic 1" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should see "Not available unless" in the "section-1" "core_availability > Section availability"
And I click on "Show more" "button" in the "section-1" "core_availability > Section availability"
And I should see "Email address" in the "section-1" "core_availability > Section availability"
@@ -161,4 +163,4 @@ Feature: display_availability
And I should not see "Email address" in the "section-1" "core_availability > Section availability"
# Section 2 should not be available at all
And I should not see "Topic 2" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
@@ -6,9 +6,9 @@ Feature: Backup Moodle courses
Background:
Given the following "courses" exist:
| fullname | shortname | category | numsections |
| Course 1 | C1 | 0 | 10 |
| Course 2 | C2 | 0 | 2 |
| fullname | shortname | category | numsections | initsections |
| Course 1 | C1 | 0 | 10 | 1 |
| Course 2 | C2 | 0 | 2 | 1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | section |
| assign | C2 | assign1 | Test assign | Assign description | 1 |
@@ -28,11 +28,11 @@ Feature: Backup Moodle courses
When I backup "Course 1" course using this options:
| Initial | Include calendar events | 0 |
| Initial | Include course logs | 1 |
| Schema | Topic 5 | 0 |
| Schema | Section 5 | 0 |
| Confirmation | Filename | test_backup.mbz |
Then I should see "Restore"
And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
And I should not see "Section 3"
And I should not see "Section 5" in the "region-main" "region"
And I press "Continue"
And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
And "No" "icon" should exist in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]" "xpath_element"
@@ -47,11 +47,11 @@ Feature: Backup Moodle courses
Scenario: Backup selecting just one section
When I backup "Course 2" course using this options:
| Schema | Test data | 0 |
| Schema | Topic 2 | 0 |
| Schema | Section 2 | 0 |
| Confirmation | Filename | test_backup.mbz |
Then I should see "Course backup area"
And I click on "Restore" "link" in the "test_backup.mbz" "table_row"
And I should not see "Section 2"
And I should not see "Section 2" in the "region-main" "region"
And I press "Continue"
And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
And I press "Next"
@@ -5,9 +5,11 @@ Feature: Duplicate activities
I need to duplicate activities inside the same course
Scenario: Duplicate an activity
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| initsections | 1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
@@ -33,6 +35,6 @@ Feature: Duplicate activities
| Name | Duplicated database name |
| Description | Duplicated database description |
And I press "Save and return to course"
Then I should see "Original database name" in the "Topic 1" "section"
And I should see "Duplicated database name" in the "Topic 1" "section"
Then I should see "Original database name" in the "Section 1" "section"
And I should see "Duplicated database name" in the "Section 1" "section"
And "Original database name" "link" should appear before "Duplicated database name" "link"
@@ -6,20 +6,24 @@ Feature: Restore Moodle 2 course backups
Background:
Given the following "courses" exist:
| fullname | shortname | category | format | numsections | coursedisplay |
| Course 1 | C1 | 0 | topics | 15 | 1 |
| Course 2 | C2 | 0 | topics | 5 | 0 |
| Course 3 | C3 | 0 | topics | 2 | 0 |
| Course 4 | C4 | 0 | topics | 20 | 0 |
| fullname | shortname | category | format | numsections | coursedisplay | initsections |
| Course 1 | C1 | 0 | topics | 15 | 1 | 1 |
| Course 2 | C2 | 0 | topics | 5 | 0 | 1 |
| Course 3 | C3 | 0 | topics | 2 | 0 | 1 |
| Course 4 | C4 | 0 | topics | 20 | 0 | 1 |
| Course 5 | C5 | 0 | topics | 15 | 1 | 0 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | section | externalurl |
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
| data | C3 | data1 | Test database name | Database description | 2 | |
| forum | C1 | 0001 | Test forum name | | 1 | |
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
| forum | C5 | 0005 | Test forum name | | 1 | |
| url | C5 | url5 | Test URL name | Test URL description | 3 | http://www.moodle.org |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| activity_modules | Course | C1 | course-view-* | side-pre |
| activity_modules | Course | C5 | course-view-* | side-pre |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@@ -41,8 +45,8 @@ Feature: Restore Moodle 2 course backups
Then I should see "Course 1 restored in a new course"
And I should see "Activities" in the "Activities" "block"
And I should see "Test forum name"
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Section 15"
And I should not see "Section 16"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
And the field "id_format" matches value "Custom sections"
@@ -79,10 +83,10 @@ Feature: Restore Moodle 2 course backups
@javascript
Scenario: Restore a backup into a new course changing the course format afterwards
Given I backup "Course 1" course using this options:
Given I backup "Course 5" course using this options:
| Confirmation | Filename | test_backup.mbz |
When I restore "test_backup.mbz" backup into a new course using this options:
Then I should see "Topic 1"
Then I should see "New section"
And I should see "Test forum name"
And I navigate to "Settings" in current page administration
And I expand all fieldsets
@@ -125,10 +129,10 @@ Feature: Restore Moodle 2 course backups
And section "3" should be visible
And section "7" should be hidden
And section "15" should be visible
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
And I should see "Section 15"
And I should not see "Section 16"
And I should see "Test URL name" in the "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@javascript
Scenario: Restore a backup in an existing course keeping the target course settings
@@ -147,10 +151,10 @@ Feature: Restore Moodle 2 course backups
And section "3" should be visible
And section "7" should be hidden
And section "15" should be visible
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
And I should see "Section 15"
And I should not see "Section 16"
And I should see "Test URL name" in the "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@javascript
Scenario: Restore a backup in an existing course deleting contents and retaining the backup course settings
@@ -171,10 +175,10 @@ Feature: Restore Moodle 2 course backups
And section "3" should be hidden
And section "7" should be hidden
And section "15" should be visible
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
And I should see "Section 15"
And I should not see "Section 16"
And I should see "Test URL name" in the "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@javascript
Scenario: Restore a backup in an existing course deleting contents and keeping the current course settings
@@ -195,10 +199,10 @@ Feature: Restore Moodle 2 course backups
And section "3" should be hidden
And section "7" should be hidden
And section "15" should be visible
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
And I should see "Section 15"
And I should not see "Section 16"
And I should see "Test URL name" in the "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@javascript
Scenario: Restore a backup in an existing course deleting contents decreasing the number of sections
@@ -219,10 +223,10 @@ Feature: Restore Moodle 2 course backups
And section "3" should be hidden
And section "7" should be hidden
And section "15" should be visible
And I should see "Topic 15"
And I should not see "Topic 16"
And I should see "Test URL name" in the "Topic 3" "section"
And I should see "Test forum name" in the "Topic 1" "section"
And I should see "Section 15"
And I should not see "Section 16"
And I should see "Test URL name" in the "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@javascript
Scenario: Restore a backup with override permission
@@ -2,9 +2,13 @@
Feature: The Section links block can be configured to display section name in addition to section number
Background:
Given the following "courses" exist:
| fullname | shortname | category | numsections | coursedisplay |
| Course 1 | C1 | 0 | 10 | 1 |
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 10 |
| coursedisplay | 1 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| assign | First assignment | C1 | assign1 | 7 |
@@ -25,8 +29,8 @@ Feature: The Section links block can be configured to display section name in ad
Scenario: Student can see section name under the Section links block
When I am on the "Course 1" course page logged in as student1
Then I should see "7: Topic 7" in the "Section links" "block"
And I follow "7: Topic 7"
Then I should see "7: Section 7" in the "Section links" "block"
And I follow "7: Section 7"
And I should see "First assignment"
Scenario: Teacher can configure existing Section links block to display section number or section name
@@ -36,7 +40,7 @@ Feature: The Section links block can be configured to display section name in ad
And I set the following fields to these values:
| Display section name | No |
And I click on "Save changes" "button"
Then I should not see "7: Topic 7" in the "Section links" "block"
Then I should not see "7: Section 7" in the "Section links" "block"
And I should see "7" in the "Section links" "block"
And I follow "7"
And I should see "First assignment"
@@ -6,10 +6,11 @@ Feature: Bulk course activity actions.
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -103,69 +104,69 @@ Feature: Bulk course activity actions.
And I click on "Select activity Activity sample 3" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
When I click on "Duplicate activities" "button" in the "sticky-footer" "region"
Then I should see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 1 (copy)" in the "Topic 1" "section"
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 1 (copy)" in the "Section 1" "section"
And "Activity sample 1 (copy)" "activity" should appear after "Activity sample 1" "activity"
And I should see "Activity sample 3" in the "Topic 2" "section"
And I should see "Activity sample 3 (copy)" in the "Topic 2" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 3 (copy)" in the "Section 2" "section"
And "Activity sample 3 (copy)" "activity" should appear after "Activity sample 3" "activity"
Scenario: Bulk delete activities
Given I should see "Activity sample 1" in the "Topic 1" "section"
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"
Given I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select activity Activity sample 1" "checkbox"
And I click on "Select activity Activity sample 3" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
When I click on "Delete activities" "button" in the "sticky-footer" "region"
And I click on "Delete" "button" in the "Delete selected activities?" "dialogue"
Then I should not see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 2" in the "Topic 1" "section"
And I should not see "Activity sample 3" in the "Topic 2" "section"
And I should see "Activity sample 4" in the "Topic 2" "section"
Then I should not see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should not see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk move activities after a specific activity
Given I should see "Activity sample 1" in the "Topic 1" "section"
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"
Given I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select activity Activity sample 1" "checkbox"
And I click on "Select activity Activity sample 3" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
When I click on "Move activities" "button" in the "sticky-footer" "region"
And I click on "Activity sample 2" "link" in the "Move selected activities" "dialogue"
And I should see "0 selected" in the "sticky-footer" "region"
# Check activities are moved to the right 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"
And I should see "Activity sample 3" in the "Topic 1" "section"
And I should not see "Activity sample 3" in the "Topic 2" "section"
And I should see "Activity sample 4" in the "Topic 2" "section"
# Check activities are moved to the right sections.
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 1" "section"
And I should not see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
# Check new activities order.
And "Activity sample 1" "activity" should appear after "Activity sample 2" "activity"
And "Activity sample 3" "activity" should appear after "Activity sample 1" "activity"
And "Activity sample 4" "activity" should appear after "Activity sample 3" "activity"
Scenario: Bulk move activities after a specific section header
Given I should see "Activity sample 1" in the "Topic 1" "section"
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"
Given I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select activity Activity sample 1" "checkbox"
And I click on "Select activity Activity sample 3" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
When I click on "Move activities" "button" in the "sticky-footer" "region"
And I click on "Topic 3" "link" in the "Move selected activities" "dialogue"
And I click on "Section 3" "link" in the "Move selected activities" "dialogue"
And I should see "0 selected" in the "sticky-footer" "region"
# Check activities are moved to the right topics.
Then I should see "Activity sample 1" in the "Topic 3" "section"
Then I should not see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 2" in the "Topic 1" "section"
And I should see "Activity sample 3" in the "Topic 3" "section"
And I should not see "Activity sample 3" in the "Topic 2" "section"
And I should see "Activity sample 4" in the "Topic 2" "section"
# Check activities are moved to the right sections.
Then I should see "Activity sample 1" in the "Section 3" "section"
Then I should not see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 3" "section"
And I should not see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
# Check new activities order.
And "Activity sample 4" "activity" should appear after "Activity sample 2" "activity"
And "Activity sample 1" "activity" should appear after "Activity sample 4" "activity"
@@ -6,10 +6,11 @@ Feature: Bulk course section actions.
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -34,12 +35,12 @@ Feature: Bulk course section actions.
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"
And I should not see "Hidden from students" in the "Activity sample 4" "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 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 section Topic 1" "checkbox"
And I click on "Select section Topic 2" "checkbox"
And I should not see "Hidden from students" in the "Section 1" "section"
And I should not see "Hidden from students" in the "Section 2" "section"
And I should not see "Hidden from students" in the "Section 3" "section"
And I should not see "Hidden from students" in the "Section 4" "section"
When I click on "Select section Section 1" "checkbox"
And I click on "Select section Section 2" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
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"
@@ -48,15 +49,15 @@ Feature: Bulk course section actions.
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"
And I should see "Hidden from students" in the "Activity sample 4" "activity"
And I should see "Hidden from students" in the "Topic 1" "section"
And I should 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"
And I should see "Hidden from students" in the "Section 1" "section"
And I should see "Hidden from students" in the "Section 2" "section"
And I should not see "Hidden from students" in the "Section 3" "section"
And I should not see "Hidden from students" in the "Section 4" "section"
And I should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk show sections
Given I click on "Select section Topic 1" "checkbox"
And I click on "Select section Topic 3" "checkbox"
Given I click on "Select section Section 1" "checkbox"
And I click on "Select section Section 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"
@@ -64,12 +65,12 @@ Feature: Bulk course section actions.
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"
And I should not see "Hidden from students" in the "Activity sample 4" "activity"
And I should see "Hidden from students" in the "Topic 1" "section"
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 section Topic 1" "checkbox"
And I click on "Select section Topic 2" "checkbox"
And I should see "Hidden from students" in the "Section 1" "section"
And I should not see "Hidden from students" in the "Section 2" "section"
And I should see "Hidden from students" in the "Section 3" "section"
And I should not see "Hidden from students" in the "Section 4" "section"
When I click on "Select section Section 1" "checkbox"
And I click on "Select section Section 2" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
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"
@@ -78,134 +79,135 @@ Feature: Bulk course section actions.
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"
And I should not see "Hidden from students" in the "Activity sample 4" "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 should see "Hidden from students" in the "Topic 3" "section"
And I should not see "Hidden from students" in the "Topic 4" "section"
And I should not see "Hidden from students" in the "Section 1" "section"
And I should not see "Hidden from students" in the "Section 2" "section"
And I should see "Hidden from students" in the "Section 3" "section"
And I should not see "Hidden from students" in the "Section 4" "section"
Scenario: Bulk delete sections with content ask for confirmation
Given 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"
And I should see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
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 section Topic 1" "checkbox"
And I click on "Select section Topic 2" "checkbox"
Given I should see "Section 1" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select section Section 1" "checkbox"
And I click on "Select section Section 2" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
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"
And I should not see "Topic 4" in the "region-main" "region"
And I should not see "Activity sample 1" in the "Topic 1" "section"
And I should not see "Activity sample 2" in the "Topic 1" "section"
And I should not see "Activity sample 3" in the "Topic 2" "section"
And I should not see "Activity sample 4" in the "Topic 2" "section"
Then I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should not see "Section 1" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should not see "Activity sample 1" in the "Section 3" "section"
And I should not see "Activity sample 2" in the "Section 3" "section"
And I should not see "Activity sample 3" in the "Section 4" "section"
And I should not see "Activity sample 4" in the "Section 4" "section"
And I should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk delete sections without content does not ask for confirmation
Given 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"
And I should see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
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 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 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"
And I should not see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
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 should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk delete both section with content and empty section ask for confirmation
Given 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"
And I should see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
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 section Topic 2" "checkbox"
And I click on "Select section Topic 3" "checkbox"
Given I should see "Section 1" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select section Section 3" "checkbox"
And I click on "Select section Section 4" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
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"
And I should not see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 1" in the "Topic 1" "section"
And I should see "Activity sample 2" in the "Topic 1" "section"
And I should not see "Activity sample 3" in the "Topic 2" "section"
And I should not see "Activity sample 4" in the "Topic 2" "section"
Then I should see "Section 1" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should not see "Section 3" in the "region-main" "region"
And I should not see "Section 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk delete both section with content and empty section ask for confirmation
Given I should see "Section 1" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select section Section 2" "checkbox"
And I click on "Select section Section 3" "checkbox"
And I should see "2 selected" in the "sticky-footer" "region"
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 "Section 1" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should not see "Section 3" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should not see "Activity sample 3" in the "Section 4" "section"
And I should not see "Activity sample 4" in the "Section 4" "section"
And I should see "0 selected" in the "sticky-footer" "region"
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"
Given I set the field "Edit section name" in the "Section 2" "section" to "Move one"
And I set the field "Edit section name" in the "Section 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 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"
# Check activities are moved with the sections.
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Move one" "section"
And I should see "Activity sample 4" in the "Move one" "section"
# Check new section order.
And "Move one" "section" should appear after "General" "section"
And "Move two" "section" should appear after "Move one" "section"
And "Topic 3" "section" should appear after "Move two" "section"
And "Topic 4" "section" should appear after "Topic 3" "section"
And "Section 1" "section" should appear after "Move two" "section"
And "Section 4" "section" should appear after "Section 1" "section"
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"
Given I set the field "Edit section name" in the "Section 3" "section" to "Move me"
And I click on "Select section Section 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 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"
And I should see "Activity sample 3" in the "Topic 3" "section"
And I should see "Activity sample 4" in the "Topic 3" "section"
And I click on "Section 4" "link" in the "Move selected sections" "dialogue"
# Check activities are moved with the sections.
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
# Check new section order.
And "Topic 1" "section" should appear after "General" "section"
And "Topic 2" "section" should appear after "Topic 1" "section"
And "Topic 3" "section" should appear after "Topic 2" "section"
And "Move me" "section" should appear after "Topic 3" "section"
And "Section 1" "section" should appear after "General" "section"
And "Section 4" "section" should appear after "Section 1" "section"
And "Section 2" "section" should appear after "Section 4" "section"
And "Move me" "section" should appear after "Section 2" "section"
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"
Given I set the field "Edit section name" in the "Section 4" "section" to "Move me"
And I click on "Select section Section 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 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"
And I should see "Activity sample 3" in the "Topic 1" "section"
And I should see "Activity sample 4" in the "Topic 1" "section"
And I click on "Section 2" "link" in the "Move selected sections" "dialogue"
# Check activities are moved with the sections.
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
# Check new section order.
And "Topic 1" "section" should appear after "General" "section"
And "Topic 2" "section" should appear after "Topic 1" "section"
And "Move me" "section" should appear after "Topic 2" "section"
And "Topic 4" "section" should appear after "Move me" "section"
And "Section 2" "section" should appear after "General" "section"
And "Section 1" "section" should appear after "Section 2" "section"
And "Move me" "section" should appear after "Section 1" "section"
And "Section 3" "section" should appear after "Move me" "section"
+55 -54
View File
@@ -6,10 +6,11 @@ Feature: Bulk activity and section selection.
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -28,7 +29,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 section Topic 1" "checkbox"
And the focused element is "Select section Section 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 +39,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 section Topic 1" "checkbox" should be disabled
Then the "Select section Section 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 section Topic 1" "checkbox"
When I click on "Select section Section 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 +75,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 section Topic 1" "checkbox"
When I click on "Select section Section 1" "checkbox"
And I should see "1 selected" in the "sticky-footer" "region"
Then the "Select all" "checkbox" should be enabled
@@ -96,35 +97,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 section Topic 1" "checkbox"
And I click on "Select section Section 1" "checkbox"
And I should see "1 selected" in the "sticky-footer" "region"
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 field "Select section Section 1" matches value "1"
And the field "Select section Section 2" matches value ""
And the field "Select section Section 3" matches value ""
And the field "Select section Section 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 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"
And the field "Select section Section 1" matches value "1"
And the field "Select section Section 2" matches value "1"
And the field "Select section Section 3" matches value "1"
And the field "Select section Section 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 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 click on "Select section Section 1" "checkbox"
And I click on "Select section Section 2" "checkbox"
And I click on "Select section Section 3" "checkbox"
And I click on "Select section Section 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 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 ""
And the focused element is "Select section Section 1" "checkbox"
And the field "Select section Section 1" matches value ""
And the field "Select section Section 2" matches value ""
And the field "Select section Section 3" matches value ""
And the field "Select section Section 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 +137,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 section Topic 1" "checkbox"
And the focused element is "Select section Section 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 ""
@@ -145,18 +146,18 @@ Feature: Bulk activity and section selection.
Scenario: Click an activity name in bulk mode select and unselects the activity
Given I click on "Bulk actions" "button"
And I should see "0 selected" in the "sticky-footer" "region"
When I click on "Activity sample 1" "link" in the "Topic 1" "section"
When I click on "Activity sample 1" "link" in the "Section 1" "section"
And the field "Activity sample 1" matches value "1"
And the field "Activity sample 2" matches value ""
And the field "Activity sample 3" matches value ""
And the field "Activity sample 4" matches value ""
And I click on "Activity sample 2" "link" in the "Topic 1" "section"
And I click on "Activity sample 2" "link" in the "Section 1" "section"
And the field "Activity sample 1" matches value "1"
And the field "Activity sample 2" matches value "1"
And the field "Activity sample 3" matches value ""
And the field "Activity sample 4" matches value ""
And I should see "2 selected" in the "sticky-footer" "region"
Then I click on "Activity sample 1" "link" in the "Topic 1" "section"
Then I click on "Activity sample 1" "link" in the "Section 1" "section"
And I should see "1 selected" in the "sticky-footer" "region"
And the field "Activity sample 1" matches value ""
And the field "Activity sample 2" matches value "1"
@@ -166,12 +167,12 @@ Feature: Bulk activity and section selection.
Scenario: Select a range of activities using shift
Given I click on "Bulk actions" "button"
And I should see "0 selected" in the "sticky-footer" "region"
When I click on "Activity sample 1" "link" in the "Topic 1" "section"
When I click on "Activity sample 1" "link" in the "Section 1" "section"
And the field "Activity sample 1" matches value "1"
And the field "Activity sample 2" matches value ""
And the field "Activity sample 3" matches value ""
And the field "Activity sample 4" matches value ""
And I shift click on "Activity sample 3" "link" in the "Topic 2" "section"
And I shift click on "Activity sample 3" "link" in the "Section 2" "section"
Then I should see "3 selected" in the "sticky-footer" "region"
And the field "Activity sample 1" matches value "1"
And the field "Activity sample 2" matches value "1"
@@ -181,7 +182,7 @@ Feature: Bulk activity and section selection.
Scenario: Select all activities in a section using alt
Given I click on "Bulk actions" "button"
And I should see "0 selected" in the "sticky-footer" "region"
When I alt click on "Activity sample 3" "link" in the "Topic 2" "section"
When I alt click on "Activity sample 3" "link" in the "Section 2" "section"
Then I should see "2 selected" in the "sticky-footer" "region"
And the field "Activity sample 1" matches value ""
And the field "Activity sample 2" matches value ""
@@ -191,31 +192,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 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"
When I click on "Select section Section 1" "checkbox"
And the field "Select section Section 1" matches value "1"
And the field "Select section Section 2" matches value ""
And the field "Select section Section 3" matches value ""
And the field "Select section Section 4" matches value ""
And I shift click on "Select section Section 3" "checkbox" in the "page" "region"
Then I should see "3 selected" in the "sticky-footer" "region"
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 ""
And the field "Select section Section 1" matches value "1"
And the field "Select section Section 2" matches value "1"
And the field "Select section Section 3" matches value "1"
And the field "Select section Section 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 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 the field "Select section Section 1" matches value ""
And the field "Select section Section 2" matches value ""
And the field "Select section Section 3" matches value ""
And the field "Select section Section 4" matches value ""
When I alt click on "Select section Section 3" "checkbox" in the "page" "region"
And I should see "4 selected" in the "sticky-footer" "region"
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"
And the field "Select section Section 1" matches value "1"
And the field "Select section Section 2" matches value "1"
And the field "Select section Section 3" matches value "1"
And the field "Select section Section 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 +225,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 section Topic 1" "checkbox"
And I click on "Select section Topic 2" "checkbox"
When I click on "Select section Section 1" "checkbox"
And I click on "Select section Section 2" "checkbox"
Then I should see "2 selected" in the "sticky-footer" "region"
@@ -11,6 +11,7 @@ Feature: Bulk course section actions one section per page
| category | 0 |
| numsections | 4 |
| coursedisplay | 1 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -31,69 +32,69 @@ 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 section Topic 1" "checkbox"
Given I click on "Select section Section 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.
# Move to single section page.
And I open section "1" edit menu
When I click on "View" "link" in the "Topic 1" "section"
When I click on "View" "link" in the "Section 1" "section"
And I click on "Bulk actions" "button"
Then "Select section Topic 1" "checkbox" should not exist
Then "Select section Section 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 section Topic 1" "checkbox"
And I should not see "Hidden from students" in the "Section 1" "section"
And I should not see "Hidden from students" in the "Section 2" "section"
And I click on "Select section Section 1" "checkbox"
And I should see "1 selected" in the "sticky-footer" "region"
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"
And I should not see "Hidden from students" in the "Topic 2" "section"
And I should see "Hidden from students" in the "Section 1" "section"
And I should not see "Hidden from students" in the "Section 2" "section"
And I should see "0 selected" in the "sticky-footer" "region"
Scenario: Bulk delete sections in one section per page
Given 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"
And I should see "Topic 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Topic 1" "section"
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 section Topic 1" "checkbox"
Given I should see "Section 1" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I click on "Select section Section 1" "checkbox"
And I should see "1 selected" in the "sticky-footer" "region"
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"
And I should not see "Topic 4" in the "region-main" "region"
And I should not see "Activity sample 1" in the "Topic 1" "section"
And I should not see "Activity sample 2" in the "Topic 1" "section"
And I should see "Activity sample 3" in the "Topic 1" "section"
And I should see "Activity sample 4" in the "Topic 1" "section"
Then I should see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Section 4" in the "region-main" "region"
And I should not see "Section 1" in the "region-main" "region"
And I should not see "Activity sample 1"
And I should not see "Activity sample 2"
And I should see "Activity sample 3" in the "Section 2" "section"
And I should see "Activity sample 4" in the "Section 2" "section"
And I should see "0 selected" in the "sticky-footer" "region"
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"
Given I set the field "Edit section name" in the "Section 2" "section" to "Move one"
And I set the field "Edit section name" in the "Section 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 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"
# Check activities are moved with the sections.
Then I should see "Activity sample 1" in the "Section 1" "section"
And I should see "Activity sample 2" in the "Section 1" "section"
And I should see "Activity sample 3" in the "Move one" "section"
And I should see "Activity sample 4" in the "Move one" "section"
# Check new section order.
And "Move one" "section" should appear after "General" "section"
And "Move two" "section" should appear after "Move one" "section"
And "Topic 3" "section" should appear after "Move two" "section"
And "Topic 4" "section" should appear after "Topic 3" "section"
And "Section 1" "section" should appear after "Move two" "section"
And "Section 4" "section" should appear after "Section 1" "section"
@@ -15,6 +15,7 @@ Feature: Course content collapsed user preferences
| category | 0 |
| enablecompletion | 1 |
| numsections | 5 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -30,40 +31,40 @@ Feature: Course content collapsed user preferences
@javascript
Scenario: Course content preferences
Given I am on the "C1" "Course" page logged in as "teacher1"
And I should see "Topic 1" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should see "Activity sample 1" in the "region-main" "region"
And I should see "Topic 2" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Activity sample 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Activity sample 3" in the "region-main" "region"
And I click on "#collapssesection1" "css_element"
When I reload the page
Then I should see "Topic 1" in the "region-main" "region"
Then I should see "Section 1" in the "region-main" "region"
And I should not see "Activity sample 1" in the "region-main" "region"
And I should see "Topic 2" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should see "Activity sample 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Activity sample 3" in the "region-main" "region"
And I click on "#collapssesection2" "css_element"
And I reload the page
And I should see "Topic 1" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should not see "Activity sample 1" in the "region-main" "region"
And I should see "Topic 2" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should not see "Activity sample 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should see "Activity sample 3" in the "region-main" "region"
And I click on "#collapssesection3" "css_element"
And I reload the page
And I should see "Topic 1" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should not see "Activity sample 1" in the "region-main" "region"
And I should see "Topic 2" in the "region-main" "region"
And I should see "Section 2" in the "region-main" "region"
And I should not see "Activity sample 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I should not see "Activity sample 3" in the "region-main" "region"
And I click on "#collapssesection2" "css_element"
And I click on "#collapssesection3" "css_element"
And I reload the page
And I should see "Topic 1" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should not see "Activity sample 1" in the "region-main" "region"
And I click on "#collapssesection4" "css_element"
And I turn editing mode on
@@ -15,6 +15,7 @@ Feature: Course index depending on role
| category | 0 |
| enablecompletion | 1 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -63,9 +64,9 @@ Feature: Course index depending on role
Scenario: Course index as a teacher
Given I log in as "teacher1"
When I am on "Course 1" course homepage
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
@@ -80,9 +81,9 @@ Feature: Course index depending on role
And I log out
And I log in as "teacher1"
When I am on "Course 1" course homepage
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
@@ -97,9 +98,9 @@ Feature: Course index depending on role
And I log out
And I log in as "student1"
When I am on "Course 1" course homepage
Then I should see "Topic 1" in the "courseindex-content" "region"
And I should not see "Topic 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should not see "Section 2" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should not see "Activity sample 2" in the "courseindex-content" "region"
And I should not see "Activity sample 3" in the "courseindex-content" "region"
@@ -133,114 +134,114 @@ Feature: Course index depending on role
| book | Second activity in section 1 | C1 | sample4 | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Sections should be opened by default.
Then I should see "Topic 1" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Collapse a section 1 via chevron.
And I click on "Collapse" "link" in the ".courseindex-section[data-number='1']" "css_element"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should not see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Expand section 1 via Topic name.
And I click on "Topic 1" "link" in the "courseindex-content" "region"
And I should see "Topic 1" in the "courseindex-content" "region"
# Expand section 1 via section name.
And I click on "Section 1" "link" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Collapse a section 2 via chevron.
And I click on "Collapse" "link" in the ".courseindex-section[data-number='2']" "css_element"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should not see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Expand section 2 via chevron.
And I click on "Expand" "link" in the ".courseindex-section[data-number='2']" "css_element"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Click a section name does not collapse the section.
And I click on "Topic 2" "link" in the "courseindex-content" "region"
And I should see "Topic 1" in the "courseindex-content" "region"
And I click on "Section 2" "link" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Second activity in section 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
@javascript
Scenario: Course index toggling all sections
When I am on the "Course 1" course page logged in as teacher1
# Sections should be opened by default.
Then I should see "Topic 1" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Collapse all sections
And I click on "Course index options" "button" in the "#courseindexdrawercontrols" "css_element"
And I click on "Collapse all" "link" in the "#courseindexdrawercontrols" "css_element"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should not see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should not see "Activity sample 3" in the "courseindex-content" "region"
# Expand all sections
And I click on "Course index options" "button" in the "#courseindexdrawercontrols" "css_element"
And I click on "Expand all" "link" in the "#courseindexdrawercontrols" "css_element"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
@javascript
Scenario: Course index section preferences
When I am on the "C1" "Course" page logged in as "teacher1"
Then I should see "Topic 1" in the "courseindex-content" "region"
Then I should see "Section 1" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Collapse section 1.
And I click on "Collapse" "link" in the ".courseindex-section[data-number='1']" "css_element"
And I reload the page
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should see "Activity sample 3" in the "courseindex-content" "region"
# Collapse section 3.
And I click on "Collapse" "link" in the ".courseindex-section[data-number='3']" "css_element"
And I reload the page
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 3" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should not see "Activity sample 3" in the "courseindex-content" "region"
# Delete section 1
And I turn editing mode on
@@ -248,9 +249,9 @@ Feature: Course index depending on role
And I click on "Delete" "button" in the ".modal" "css_element"
And I reload the page
And I should not see "Activity sample 1" in the "courseindex-content" "region"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
And I should see "Activity sample 2" in the "courseindex-content" "region"
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 3" in the "courseindex-content" "region"
And I should not see "Activity sample 3" in the "courseindex-content" "region"
@javascript
@@ -258,14 +259,15 @@ Feature: Course index depending on role
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I click on "Add section" "link" in the "course-addsection" "region"
Then I should see "Topic 5" in the "courseindex-content" "region"
Then I should see "New section" in the "courseindex-content" "region"
@javascript
Scenario: Remove a 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 delete section "4"
Then I should not see "Topic 4" in the "courseindex-content" "region"
And I click on "Delete" "button" in the ".modal" "css_element"
Then I should not see "Section 4" in the "courseindex-content" "region"
@javascript
Scenario: Delete a previous section should alter the course index unnamed sections
@@ -273,7 +275,7 @@ Feature: Course index depending on role
And I am on "Course 1" course homepage with editing mode on
When I delete section "1"
And I click on "Delete" "button" in the ".modal" "css_element"
Then I should not see "Topic 4" in the "courseindex-content" "region"
Then I should not see "Section 1" in the "courseindex-content" "region"
And I should not see "Activity sample 1" in the "courseindex-content" "region"
@javascript
@@ -301,7 +303,7 @@ Feature: Course index depending on role
# Check course index link goes to the specific section.
When I log in as "student1"
And I am on "Course 1" course homepage
And I click on "Topic 1" "link" in the "region-main" "region"
And I click on "Section 1" "link" in the "region-main" "region"
And I should not see "Activity sample 3" in the "region-main" "region"
And I click on "Activity sample 3" "link" in the "courseindex-content" "region"
Then I should see "Activity sample 3" in the "region-main" "region"
@@ -333,10 +335,10 @@ Feature: Course index depending on role
And I turn editing mode on
And I hide section "1"
And I turn editing mode off
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And I follow "Switch role to..." in the user menu
And I press "Student"
Then I should not see "Topic 1" in the "courseindex-content" "region"
Then I should not see "Section 1" in the "courseindex-content" "region"
@javascript
Scenario: Course index behaviour for activities without url
@@ -367,7 +369,7 @@ Feature: Course index depending on role
| label | Activity sample 5 | Test label 1 | C1 | sample4 | 2 |
| label | | Test label 2 | C1 | sample5 | 2 |
When I am on the "Course 1" course page logged in as teacher1
And I should see "Topic 2" in the "courseindex-content" "region"
And I should see "Section 2" in the "courseindex-content" "region"
# Label name should be displayed if it is set.
And I should see "Activity sample 5" in the "courseindex-content" "region"
# Label intro text should be displayed if label name is not set.
@@ -6,10 +6,11 @@ Feature: Verify edit utils availability
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 3 |
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 3 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -38,8 +39,8 @@ Feature: Verify edit utils availability
Then I should see "Add an activity or resource"
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 ".section_action_menu" "css_element" should exist in the "Section 1" "section"
And I click on ".section_action_menu" "css_element" in the "Section 1" "section"
And I should see "Edit settings"
@javascript
@@ -73,6 +74,6 @@ Feature: Verify edit utils availability
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 ".section_action_menu" "css_element" should exist in the "Section 1" "section"
And I click on ".section_action_menu" "css_element" in the "Section 1" "section"
And I should see "Edit settings"
@@ -28,14 +28,14 @@ Feature: Course index completion icons
@javascript
Scenario: Teacher does not see completion icons.
When I am on the "C1" "Course" page logged in as "teacher1"
Then I should see "Topic 1" in the "courseindex-content" "region"
Then I should see "New section" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And "To do" "icon" should not exist in the "courseindex-content" "region"
@javascript
Scenario: User should see the completion icons
When I am on the "C1" "Course" page logged in as "student1"
Then I should see "Topic 1" in the "courseindex-content" "region"
Then I should see "New section" in the "courseindex-content" "region"
And I should see "Activity sample 1" in the "courseindex-content" "region"
And "To do" "icon" should exist in the "courseindex-content" "region"
@@ -11,6 +11,7 @@ Feature: Verify that courseindex is usable with the keyboard
| category | 0 |
| enablecompletion | 1 |
| numsections | 3 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -20,7 +21,7 @@ Feature: Verify that courseindex is usable with the keyboard
And I change window size to "large"
And I click on "Close course index" "button"
And I click on "Open course index" "button"
And I should see "Topic 1" in the "courseindex-content" "region"
And I should see "Section 1" in the "courseindex-content" "region"
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
And I press the tab key
And I press the tab key
@@ -32,7 +33,7 @@ Feature: Verify that courseindex is usable with the keyboard
And I press the shift tab key
And the focused element is "[data-preference='drawer-open-index'] .drawertoggle" "css_element"
And I press enter
Then I should not see "Topic 1" in the "courseindex-content" "region"
Then I should not see "Section 1" in the "courseindex-content" "region"
@javascript @accessibility
Scenario: Course index should be accessible.
@@ -5,30 +5,37 @@ Feature: Duplicate a section
I need to duplicate sections inside the same course
Background:
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
| numsections | 4 |
Given the following "courses" exist:
| fullname | shortname | category | enablecompletion | numsections | initsections |
| Course 1 | C1 | 0 | 1 | 1 | 0 |
| Course 2 | C2 | 0 | 1 | 4 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
| book | Activity sample 2 | Test book description | C1 | sample2 | 1 |
| choice | Activity sample 3 | Test choice description | C1 | sample3 | 2 |
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1.1 | Test assignment description | C1 | sample11 | 1 |
| book | Activity sample 1.2 | Test book description | C1 | sample12 | 1 |
| assign | Activity sample 2.1 | Test assignment description | C2 | sample21 | 1 |
| book | Activity sample 2.2 | Test book description | C2 | sample22 | 1 |
| choice | Activity sample 2.3 | Test choice description | C2 | sample23 | 2 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
@javascript
Scenario: Duplicate section
Given I open section "1" edit menu
When I click on "Duplicate" "link" in the "Topic 1" "section"
Then I should see "Activity sample 2" in the "Topic 2" "section"
Scenario: Duplicate unnamed section
Given the following config values are set as admin:
| unaddableblocks | | theme_boost|
And I am on "Course 1" course homepage with editing mode on
And I add the "Section links" block
When I open section "1" edit menu
And I click on "Duplicate" "link" in the "New section" "section"
# As the section names are the same, the only way to access the section is through the section links block.
And I click on "2" "link" in the "Section links" "block"
Then I should see "Activity sample 1.2"
And I should see "New section"
@javascript
Scenario: Duplicate a named section
Given I set the field "Edit section name" in the "Topic 1" "section" to "New name"
Given I am on "Course 2" course homepage with editing mode on
And I set the field "Edit section name" in the "Section 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"
Then I should see "Activity sample 2" in the "New name (copy)" "section"
Then I should see "Activity sample 2.2" in the "New name (copy)" "section"
@@ -11,6 +11,7 @@ Feature: Move activity using keyboard
| category | 0 |
| enablecompletion | 1 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -31,7 +32,7 @@ Feature: Move activity using keyboard
And I press the down key
And I press the down key
And I press enter
Then I should see "Activity sample 3" in the "Topic 2" "section"
Then I should see "Activity sample 3" in the "Section 2" "section"
@javascript
Scenario: Move activity to another section selecting an inner activity
@@ -47,7 +48,7 @@ Feature: Move activity using keyboard
# Select first activity.
And I press the down key
And I press enter
Then I should see "Activity sample 3" in the "Topic 2" "section"
Then I should see "Activity sample 3" in the "Section 2" "section"
@javascript
Scenario: Close a section in the move modal
@@ -65,7 +66,7 @@ Feature: Move activity using keyboard
# Move to section 4.
And I press the down key
And I press enter
Then I should see "Activity sample 3" in the "Topic 4" "section"
Then I should see "Activity sample 3" in the "Section 4" "section"
@javascript
Scenario: Move activity using open all sections
@@ -87,7 +88,7 @@ Feature: Move activity using keyboard
And I press the down key
And I press the down key
And I press enter
Then I should see "Activity sample 3" in the "Topic 4" "section"
Then I should see "Activity sample 3" in the "Section 4" "section"
@javascript
Scenario: Move activity using go to the last element
@@ -100,7 +101,7 @@ Feature: Move activity using keyboard
And I press the end key
# Move down to section 4
And I press enter
Then I should see "Activity sample 3" in the "Topic 4" "section"
Then I should see "Activity sample 3" in the "Section 4" "section"
@javascript
Scenario: Move activity using go to the first element
@@ -11,6 +11,7 @@ Feature: Move a section using keyboard
| category | 0 |
| enablecompletion | 1 |
| numsections | 4 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -23,19 +24,19 @@ Feature: Move a section using keyboard
@javascript
Scenario: Move section above another section
Given I open section "3" edit menu
And I click on "Move" "link" in the "Topic 3" "section"
And I click on "Move" "link" in the "Section 3" "section"
# Focus on the modal content tree.
When I press the tab key
And I press the tab key
# Select the section 1.
And I press the down key
And I press enter
Then I should see "Activity sample 3" in the "Topic 2" "section"
Then "Section 2" "section" should appear after "Section 3" "section"
@javascript
Scenario: Move section using go to the last element
Given I open section "2" edit menu
And I click on "Move" "link" in the "Topic 2" "section"
And I click on "Move" "link" in the "Section 2" "section"
# Focus on the modal content tree.
When I press the tab key
And I press the tab key
@@ -43,12 +44,12 @@ Feature: Move a section using keyboard
And I press the end key
# Move down to section 4
And I press enter
Then I should see "Activity sample 2" in the "Topic 4" "section"
Then "Section 2" "section" should appear after "Section 4" "section"
@javascript
Scenario: Move section using go to the first element
Given I open section "3" edit menu
And I click on "Move" "link" in the "Topic 3" "section"
And I click on "Move" "link" in the "Section 3" "section"
# Focus on the modal content tree.
When I press the tab key
And I press the tab key
@@ -59,4 +60,4 @@ Feature: Move a section using keyboard
# Go to the first section.
And I press the home key
And I press enter
Then I should see "Activity sample 3" in the "Topic 1" "section"
Then "Section 1" "section" should appear after "Section 3" "section"
@@ -10,6 +10,7 @@ Feature: Single section course page
| shortname | C1 |
| category | 0 |
| numsections | 3 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | course | idnumber | section |
| assign | Activity sample 0.1 | C1 | sample1 | 0 |
@@ -30,7 +31,7 @@ Feature: Single section course page
Scenario: Collapsed sections are always expanded in the single section page
Given I press "Collapse all"
And I should not see "Activity sample 1.1" in the "region-main" "region"
When I am on the "Course 1 > Topic 1" "course > section" page
When I am on the "Course 1 > Section 1" "course > section" page
Then I should see "Activity sample 1.1"
And I should see "Activity sample 1.2"
And I should see "Activity sample 1.3"
@@ -38,7 +39,7 @@ Feature: Single section course page
And I should not see "Activity sample 2.1" in the "region-main" "region"
Scenario: General section is not displayed in the single section page
When I am on the "Course 1 > Topic 1" "course > section" page
When I am on the "Course 1 > Section 1" "course > section" page
Then I should not see "General" in the "#section-1" "css_element"
And I should not see "Activity sample 0.1" in the "region-main" "region"
And I should see "Activity sample 1.1"
@@ -51,7 +52,7 @@ Feature: Single section course page
Scenario: The view action for sections displays the single section page
Given I turn editing mode on
And I open section "1" edit menu
When I click on "View" "link" in the "Topic 1" "section"
When I click on "View" "link" in the "Section 1" "section"
Then I should not see "General" in the "#section-1" "css_element"
And I should not see "Activity sample 0.1" in the "region-main" "region"
And I should see "Activity sample 1.1"
@@ -61,7 +62,7 @@ Feature: Single section course page
And I should not see "Activity sample 2.1" in the "region-main" "region"
And I am on "Course 1" course homepage
And I open section "2" edit menu
And I click on "View" "link" in the "Topic 2" "section"
And I click on "View" "link" in the "Section 2" "section"
And I should not see "General" in the "#section-2" "css_element"
And I should not see "Activity sample 0.1" in the "region-main" "region"
And I should not see "Activity sample 1.1"
@@ -9,7 +9,7 @@ Feature: Varify section visibility interface
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| numsections | 3 |
| numsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Activity sample 1 | Test assignment description | C1 | sample1 | 1 |
@@ -34,10 +34,10 @@ Feature: Varify section visibility interface
@javascript
Scenario: Hide a section also hides the activities.
When I hide section "1"
Then I should see "Hidden from students" in the "Topic 1" "section"
Then I should see "Hidden from students" in the "New section" "section"
And I should see "Hidden from students" in the "Activity sample 1" "activity"
And I show section "1"
And I should not see "Hidden from students" in the "Topic 1" "section"
And I should not see "Hidden from students" in the "New section" "section"
And I should not see "Hidden from students" in the "Activity sample 1" "activity"
@javascript
+20
View File
@@ -29,6 +29,8 @@
* @return bool result
*/
function xmldb_format_topics_upgrade($oldversion) {
global $DB;
// Automatically generated Moodle v4.1.0 release upgrade line.
// Put any upgrade step following this.
@@ -49,5 +51,23 @@ function xmldb_format_topics_upgrade($oldversion) {
// Automatically generated Moodle v4.3.0 release upgrade line.
// Put any upgrade step following this.
if ($oldversion < 2023100901) {
// During the migration to version 4.4, ensure that sections with null names are renamed to their corresponding
// previous 'Topic X' for continuity.
$newsectionname = $DB->sql_concat("'Topic '", 'section');
$sql = <<<EOF
UPDATE {course_sections}
SET name = $newsectionname
WHERE section > 0 AND (name IS NULL OR name = '')
AND course IN (SELECT id FROM {course} WHERE format = 'topics')
EOF;
$DB->execute(
sql: $sql,
);
// Main savepoint reached.
upgrade_plugin_savepoint(true, 2023100901, 'format', 'topics');
}
return true;
}
@@ -24,6 +24,8 @@
$string['currentsection'] = 'Current section';
$string['hidefromothers'] = 'Hide';
$string['legacysectionname'] = 'Topic';
$string['newsection'] = 'New section';
$string['page-course-view-topics'] = 'Any course main page in custom sections format';
$string['page-course-view-topics-x'] = 'Any course page in custom sections format';
$string['pluginname'] = 'Custom sections';
@@ -34,5 +36,5 @@ $string['indentation_help'] = 'Allow teachers, and other users with the manage a
$string['section_highlight_feedback'] = 'Section {$a->name} highlighted.';
$string['section_unhighlight_feedback'] = 'Highlighting removed from section {$a->name}.';
$string['section0name'] = 'General';
$string['sectionname'] = 'Topic';
$string['sectionname'] = 'Section';
$string['showfromothers'] = 'Show';
+6 -9
View File
@@ -76,21 +76,18 @@ class format_topics extends core_courseformat\base {
* Returns the default section name for the topics course format.
*
* If the section number is 0, it will use the string with key = section0name from the course format's lang file.
* If the section number is not 0, the base implementation of course_format::get_default_section_name which uses
* the string with the key = 'sectionname' from the course format's lang file + the section number will be used.
* If the section number is not 0, it will consistently return the name 'newsection', disregarding the specific section number.
*
* @param stdClass $section Section object from database or just field course_sections section
* @param int|stdClass $section Section object from database or just field course_sections section
* @return string The default value for the section name.
*/
public function get_default_section_name($section) {
if ($section->section == 0) {
// Return the general section.
$section = $this->get_section($section);
if ($section->sectionnum == 0) {
return get_string('section0name', 'format_topics');
} else {
// Use course_format::get_default_section_name implementation which
// will display the section name in "Topic n" format.
return parent::get_default_section_name($section);
}
return get_string('newsection', 'format_topics');
}
/**
@@ -9,8 +9,9 @@ Feature: Sections can be edited and deleted in custom sections format
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
| fullname | shortname | format | coursedisplay | numsections | initsections |
| Course 1 | C1 | topics | 0 | 5 | 1 |
| Course 2 | C2 | topics | 0 | 1 | 0 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
@@ -20,88 +21,100 @@ Feature: Sections can be edited and deleted in custom sections format
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
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 custom sections format
Given I am on "Course 1" course homepage with editing mode on
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 custom sections format
Given I should see "General" in the "General" "section"
Given I am on "Course 1" course homepage with editing mode on
And 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 "page" "region"
Scenario: View the default name of the second section in custom sections format
When I edit the section "2"
Given I am on "Course 2" course homepage with editing mode on
When I edit the section "1"
Then the field "Custom" matches value "0"
And the field "New value for Section name" matches value "Topic 2"
And the field "New value for Section name" matches value "New section"
Scenario: Edit section summary in custom sections format
Given I am on "Course 1" course homepage with editing mode on
When I edit the section "2" and I fill the form with:
| Description | Welcome to section 2 |
Then I should see "Welcome to section 2" in the "page" "region"
Scenario: Edit section default name in custom sections format
Given I am on "Course 1" course homepage with editing mode on
When I edit the section "2" and I fill the form with:
| Custom | 1 |
| New value for Section name | This is the second topic |
Then I should see "This is the second topic" in the "page" "region"
And I should not see "Topic 2" in the "region-main" "region"
| New value for Section name | This is the second section |
Then I should see "This is the second section" in the "page" "region"
And I should not see "Section 2" in the "region-main" "region"
@javascript
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"
Given I am on "Course 1" course homepage with editing mode on
When I set the field "Edit section name" in the "Section 1" "section" to "Midterm evaluation"
Then I should not see "Section 1" in the "region-main" "region"
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 not see "Section 1" in the "region-main" "region"
And I should see "Midterm evaluation" in the "Midterm evaluation" "section"
Scenario: Deleting the last section in custom sections format
Given I am on "Course 1" course homepage with editing mode on
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?"
Then I should see "Are you absolutely sure you want to completely delete \"Section 5\" and all the activities it contains?"
And I press "Delete"
And I should not see "Topic 5"
And I should see "Topic 4"
And I should not see "Section 5"
And I should see "Section 4"
Scenario: Deleting the middle section in custom sections format
Given I am on "Course 1" course homepage with editing mode on
When I delete section "4"
And I press "Delete"
Then I should not see "Topic 5"
Then I should not see "Section 4"
And I should see "Section 5"
And I should not see "Test lesson name"
And I should see "Test choice name" in the "Topic 4" "section"
And I should see "Topic 4"
And I should see "Test choice name" in the "Section 5" "section"
@javascript
Scenario: Adding sections at the end of a custom sections format
Given I am on "Course 1" course homepage with editing mode on
When I click on "Add section" "link" in the "course-addsection" "region"
Then I should see "Topic 6" in the "Topic 6" "section"
And I should see "Test choice name" in the "Topic 5" "section"
Then I should see "New section" in the "New section" "section"
And I should see "Test choice name" in the "Section 5" "section"
@javascript
Scenario: Adding sections between topics in custom sections format
Given I hover over the "Add section" "link" in the "Topic 4" "section"
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"
Scenario: Adding sections between in custom sections format
Given I am on "Course 1" course homepage with editing mode on
When I hover over the "Add section" "link" in the "Section 4" "section"
And I click on "Add section" "link" in the "Section 4" "section"
Then I should see "New section" in the "New section" "section"
And I should see "Test choice name" in the "Section 5" "section"
And I should not see "Test choice name" in the "New section" "section"
@javascript
Scenario: Add a topic and then add an activity in it
Scenario: Add a section and then add an activity in it
Given I am on "Course 1" course homepage with editing mode on
When I click on "Add section" "link" in the "course-addsection" "region"
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"
Then I should see "Very new activity" in the "New section" "section"
@javascript
Scenario: Copy section permalink URL to clipboard
Given I am on "Course 1" course homepage with editing mode on
When I open section "1" edit menu
And I click on "Permalink" "link" in the "Topic 1" "section"
And I click on "Permalink" "link" in the "Section 1" "section"
And I click on "Copy to clipboard" "link" in the "Permalink" "dialogue"
Then I should see "Text copied to clipboard"
@@ -8,9 +8,13 @@ Feature: Sections can be highlighted
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| coursedisplay | 0 |
| numsections | 5 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| assign | Test assignment name | Test assignment description | C1 | assign1 | 0 |
@@ -26,24 +30,24 @@ Feature: Sections can be highlighted
@javascript
Scenario: Highlight a section
When I open section "2" edit menu
And I click on "Highlight" "link" in the "Topic 2" "section"
Then I should see "Highlighted" in the "Topic 2" "section"
And I click on "Highlight" "link" in the "Section 2" "section"
Then I should see "Highlighted" in the "Section 2" "section"
@javascript
Scenario: Highlight a section when another section is already highlighted
Given I open section "3" edit menu
And I click on "Highlight" "link" in the "Topic 3" "section"
And I should see "Highlighted" in the "Topic 3" "section"
And I click on "Highlight" "link" in the "Section 3" "section"
And I should see "Highlighted" in the "Section 3" "section"
When I open section "2" edit menu
And I click on "Highlight" "link" in the "Topic 2" "section"
Then I should see "Highlighted" in the "Topic 2" "section"
And I should not see "Highlighted" in the "Topic 3" "section"
And I click on "Highlight" "link" in the "Section 2" "section"
Then I should see "Highlighted" in the "Section 2" "section"
And I should not see "Highlighted" in the "Section 3" "section"
@javascript
Scenario: Unhighlight a section
Given I open section "3" edit menu
And I click on "Highlight" "link" in the "Topic 3" "section"
And I should see "Highlighted" in the "Topic 3" "section"
And I click on "Highlight" "link" in the "Section 3" "section"
And I should see "Highlighted" in the "Section 3" "section"
When I open section "3" edit menu
And I click on "Unhighlight" "link" in the "Topic 3" "section"
Then I should not see "Highlighted" in the "Topic 3" "section"
And I click on "Unhighlight" "link" in the "Section 3" "section"
Then I should not see "Highlighted" in the "Section 3" "section"
@@ -118,7 +118,7 @@ class format_topics_test extends \advanced_testcase {
$sectionname = get_string('section0name', 'format_topics');
$this->assertEquals($sectionname, $courseformat->get_default_section_name($section));
} else {
$sectionname = get_string('sectionname', 'format_topics') . ' ' . $section->section;
$sectionname = get_string('newsection', 'format_topics');
$this->assertEquals($sectionname, $courseformat->get_default_section_name($section));
}
}
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2023100900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2023100901; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2023100400; // Requires this Moodle version.
$plugin->component = 'format_topics'; // Full name of the plugin (used for diagnostics).
+2
View File
@@ -52,6 +52,8 @@ and replaced by core_courseformat\base::set_sectionnum() and core_courseformat\b
value when all the sections must be displayed (instead of 0). That way, section 0 (General), can be displayed on a single page too.
* The course format setting has been updated to use a choice dropdown form element instead of a select element. Third-party
plugins can now include the string 'plugin_description' to provide a description of the course format.
* A new item, initsections, has been added to the testing_data_generator::create_course() function, to let the generator rename
the sections to "Section X".
=== 4.3 ===
* New core_courseformat\output\activitybadge class that can be extended by any module to display content near the activity name.
+29 -27
View File
@@ -8,9 +8,11 @@ Feature: Display and choose from the available activities in course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | Teacher | 1 | teacher@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course | C | topics |
And the following "course" exists:
| fullname | Course |
| shortname | C |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C | editingteacher |
@@ -20,33 +22,33 @@ Feature: Display and choose from the available activities in course
And I am on "Course" course homepage with editing mode on
Scenario: The available activities are displayed to the teacher in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
Then I should see "Add an activity or resource" in the ".modal-title" "css_element"
And I should see "Assignment" in the ".modal-body" "css_element"
Scenario: The teacher can choose to add an activity from the activity items in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 4" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
Then I should see "New Assignment"
And I set the following fields to these values:
| Assignment name | Test Assignment Topic 4 |
| Assignment name | Test Assignment |
And I press "Save and return to course"
Then I should see "Test Assignment Topic 4" in the "Topic 4" "section"
Then I should see "Test Assignment" in the "New section" "section"
Scenario: The teacher can choose to add an activity from the activity summary in the activity chooser
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
When I click on "Add a new Assignment" "link" in the "help" "core_course > Activity chooser screen"
Then I should see "New Assignment"
Scenario: Show summary
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I click on "Information about the Assignment activity" "button" in the "Add an activity or resource" "dialogue"
Then I should see "Assignment" in the "help" "core_course > Activity chooser screen"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback."
Scenario: Hide summary
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I click on "Information about the Assignment activity" "button" in the "modules" "core_course > Activity chooser screen"
And I should see "The assignment activity module enables a teacher to communicate tasks, collect work and provide grades and feedback." in the "help" "core_course > Activity chooser screen"
And I should see "Back" in the "help" "core_course > Activity chooser screen"
@@ -87,7 +89,7 @@ Feature: Display and choose from the available activities in course
And I click on "Star Forum activity" "button" in the "Add an activity or resource" "dialogue"
And I should see "Starred" in the "Add an activity or resource" "dialogue"
And I click on "Close" "button" in the "Add an activity or resource" "dialogue"
When I click on "Add an activity or resource" "button" in the "Topic 3" "section"
When I click on "Add an activity or resource" "button" in the "New section" "section"
And I click on "Starred" "link" in the "Add an activity or resource" "dialogue"
Then I should see "Forum" in the "favourites" "core_course > Activity chooser tab"
@@ -99,7 +101,7 @@ Feature: Display and choose from the available activities in course
Then I should not see "Starred" in the "Add an activity or resource" "dialogue"
Scenario: The teacher can search for an activity by it's name
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I set the field "search" to "Lesson"
Then I should see "1 results found" in the "Add an activity or resource" "dialogue"
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
@@ -111,13 +113,13 @@ Feature: Display and choose from the available activities in course
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
Scenario: Search results are not returned if the search query does not match any activity name or description
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I set the field "search" to "Random search query"
Then I should see "0 results found" in the "Add an activity or resource" "dialogue"
And ".option" "css_element" should not exist in the ".searchresultitemscontainer" "css_element"
Scenario: Teacher can return to the default activity chooser state by manually removing the search query
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
And I set the field "search" to "Lesson"
And I should see "1 results found" in the "Add an activity or resource" "dialogue"
And I should see "Lesson" in the "Add an activity or resource" "dialogue"
@@ -127,16 +129,16 @@ Feature: Display and choose from the available activities in course
And ".optionscontainer" "css_element" should exist
Scenario: Teacher can not see a "clear" button if a search query is not entered in the activity chooser search bar
When I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Add an activity or resource" "button" in the "New section" "section"
Then "Clear search input" "button" should not be visible
Scenario: Teacher can see a "clear" button after entering a search query in the activity chooser search bar
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
When I set the field "search" to "Search query"
Then "Clear search input" "button" should not be visible
Scenario: Teacher can not see a "clear" button if the search query is removed in the activity chooser search bar
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
And I set the field "search" to "Search query"
And "Clear search input" "button" should exist
When I set the field "search" to ""
@@ -145,7 +147,7 @@ Feature: Display and choose from the available activities in course
Then "Clear search input" "button" should not be visible
Scenario: Teacher can instantly remove the search query from the activity search bar by clicking on the "clear" button
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
And I set the field "search" to "Search query"
And I should see "results found" in the "Add an activity or resource" "dialogue"
When I click on "Clear search input" "button"
@@ -154,7 +156,7 @@ Feature: Display and choose from the available activities in course
And ".optionscontainer" "css_element" should exist
Scenario: Teacher gets the base case for the Activity Chooser tab mode
Given I click on "Add an activity or resource" "button" in the "Topic 1" "section"
Given I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Activities" in the "Add an activity or resource" "dialogue"
When I click on "Activities" "link" in the "Add an activity or resource" "dialogue"
Then I should not see "Book" in the "activity" "core_course > Activity chooser tab"
@@ -171,7 +173,7 @@ Feature: Display and choose from the available activities in course
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
Then I should not see "Activities" in the "Add an activity or resource" "dialogue"
And I should not see "Resources" in the "Add an activity or resource" "dialogue"
@@ -185,7 +187,7 @@ Feature: Display and choose from the available activities in course
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
Then I should not see "All" in the "Add an activity or resource" "dialogue"
And I should see "Activities" in the "Add an activity or resource" "dialogue"
And I should see "Resources" in the "Add an activity or resource" "dialogue"
@@ -201,35 +203,35 @@ Feature: Display and choose from the available activities in course
And I log out
And I log in as "teacher"
And I am on "Course" course homepage with editing mode on
When I click on "Add an activity or resource" "button" in the "Topic 1" "section"
When I click on "Add an activity or resource" "button" in the "New section" "section"
Then "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 0 = Starred, All, Activities, Resources, Recommended
| activitychoosertabmode | 0 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 1 = Starred, All, Recommended
| activitychoosertabmode | 1 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And "Recommended" "link" should appear after "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 2 = Starred, Activities, Resources, Recommended
| activitychoosertabmode | 2 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And "Recommended" "link" should appear after "Resources" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 4 = Starred, Recommended, All
| activitychoosertabmode | 4 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And "Recommended" "link" should appear before "All" "link" in the "Add an activity or resource" "dialogue"
But the following config values are set as admin:
# 5 = Starred, Recommended, Activities, Resources
| activitychoosertabmode | 5 |
And I reload the page
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And "Recommended" "link" should appear before "Activities" "link" in the "Add an activity or resource" "dialogue"
@@ -8,9 +8,11 @@ Feature: Use the activity chooser to insert activities anywhere in a section
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | Teacher | 1 | teacher@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course | C | topics |
And the following "course" exists:
| fullname | Course |
| shortname | C |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C | editingteacher |
@@ -36,7 +38,7 @@ Feature: Use the activity chooser to insert activities anywhere in a section
And I set the following fields to these values:
| Assignment name | Test Assignment |
And I press "Save and return to course"
And I should see "Test Assignment" in the "Topic 1" "section"
And I should see "Test Assignment" in the "New section" "section"
# Ensure the new assignment is in the middle of the two existing modules.
Then "Test Page" "text" should appear before "Test Assignment" "text"
And "Test Assignment" "text" should appear before "Test Forum" "text"
@@ -2,22 +2,17 @@
Feature: Collapse course sections
In order to quickly access the course structure
As a user
I need to collapse/extend sections for Topics/Weeks formats.
I need to collapse/extend sections for course formats.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| enablecompletion | 1 |
| numsections | 5 |
| startdate | 957139200 |
| enablecompletion | 1 |
| hiddensections | 0 |
And the following "courses" exist:
| fullname | shortname | category | format | enablecompletion | numsections | startdate | enablecompletion | hiddensections | initsections |
| Course 1 | C1 | 0 | topics | 1 | 5 | 957139200 | 1 | 0 | 1 |
| Course 2 | C2 | 0 | weeks | 1 | 5 | 957139200 | 1 | 0 | 0 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | completion |
| assign | Assignment 1 | Test assignment description1 | C1 | assign1 | 1 | 1 |
@@ -26,10 +21,18 @@ Feature: Collapse course sections
| book | Book 3 | | C1 | book3 | 3 | 1 |
| forum | Forum 4 | | C1 | forum4 | 4 | 1 |
| forum | Forum 5 | | C1 | forum5 | 5 | 1 |
| assign | Assignment 1 | Test assignment description1 | C2 | assign1 | 1 | 1 |
| assign | Assignment 2 | Test assignment description2 | C2 | assign2 | 2 | 1 |
| book | Book 2 | | C2 | book2 | 2 | 1 |
| book | Book 3 | | C2 | book3 | 3 | 1 |
| forum | Forum 4 | | C2 | forum4 | 4 | 1 |
| forum | Forum 5 | | C2 | forum5 | 5 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
| student1 | C2 | student |
| teacher1 | C2 | editingteacher |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I hide section "5"
@@ -40,6 +43,15 @@ Feature: Collapse course sections
And I set the field "direction" to "until"
And I set the field "x[year]" to "2013"
And I press "Save changes"
And I am on "Course 2" course homepage with editing mode on
And I hide section "5"
And I edit the section "4"
And I expand all fieldsets
And I press "Add restriction..."
And I click on "Date" "button" in the "Add restriction..." "dialogue"
And I set the field "direction" to "until"
And I set the field "x[year]" to "2013"
And I press "Save changes"
@javascript
Scenario: No chevron on site home
@@ -97,12 +109,7 @@ Feature: Collapse course sections
@javascript
Scenario: Expand/collapse sections for Weeks 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
And I set the following fields to these values:
| Format | Weekly sections |
And I press "Save and display"
Given I am on the "Course 2" course page logged in as teacher1
And I should see "Assignment 1" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And I should see "Book 2" in the "region-main" "region"
@@ -151,11 +158,11 @@ Feature: Collapse course sections
| Course layout | Show one section per page |
And I press "Save and display"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I click on "Section 2" "link" in the "region-main" "region"
And I should see "Assignment 2" in the "region-main" "region"
And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region"
Then "Topic 1" "section" should not exist
And "Topic 3" "section" should not exist
Then "Section 1" "section" should not exist
And "Section 3" "section" should not exist
And I am on "Course 1" course homepage with editing mode on
And I should see "Available until" in the "section-4" "core_availability > Section availability"
And I should see "2013" in the "section-4" "core_availability > Section availability"
@@ -165,12 +172,11 @@ Feature: Collapse course sections
@javascript
Scenario: Users don't see chevron on one section per page for Weeks format
Given I am on the "Course 1" course page logged in as teacher1
Given I am on the "Course 2" course page logged in as teacher1
When I navigate to "Settings" in current page administration
And I expand all fieldsets
And I set the following fields to these values:
| Course layout | Show one section per page |
| 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"
+34 -24
View File
@@ -20,9 +20,14 @@ Feature: Course activity controls works as expected
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | <courseformat> |
|coursedisplay | <coursedisplay> |
| numsections | 5 |
| startdate | 0 |
| initsections | <initsections> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -78,23 +83,28 @@ Feature: Course activity controls works as expected
And I should not see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetsectionnum | targetpage | belowpage | firstsection |
| topics | 0 | 0 | "General" | "Topic 2" | "Topic 1" |
| topics | 1 | 0 | "General" | "Topic 2" | "Topic 1" |
| topics | 0 | 1 | "Topic 1" | "Topic 2" | "Topic 1" |
| topics | 1 | 1 | "Topic 1" | "Topic 2" | "Topic 1" |
| weeks | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| courseformat | coursedisplay | initsections | targetsectionnum | targetpage | belowpage | firstsection |
| topics | 0 | 1 | 0 | "General" | "Section 2" | "Section 1" |
| topics | 1 | 1 | 0 | "General" | "Section 2" | "Section 1" |
| topics | 0 | 1 | 1 | "Section 1" | "Section 2" | "Section 1" |
| topics | 1 | 1 | 1 | "Section 1" | "Section 2" | "Section 1" |
| weeks | 0 | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 0 | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
Scenario Outline: Check, without javascript, activities using topics and weeks formats, and paged mode and not paged mode
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | <courseformat> | <coursedisplay> | 5 | 0 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | <courseformat> |
|coursedisplay | <coursedisplay> |
| numsections | 5 |
| startdate | 0 |
| initsections | <initsections> |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -141,15 +151,15 @@ Feature: Course activity controls works as expected
And I should not see "Test forum name 2"
Examples:
| courseformat | coursedisplay | targetsectionnum | targetpage | belowpage | firstsection |
| topics | 0 | 0 | "General" | "Topic 2" | "Topic 1" |
| topics | 1 | 0 | "General" | "Topic 2" | "Topic 1" |
| topics | 0 | 1 | "Topic 1" | "Topic 2" | "Topic 1" |
| topics | 1 | 1 | "Topic 1" | "Topic 2" | "Topic 1" |
| weeks | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| courseformat | coursedisplay | initsections | targetsectionnum | targetpage | belowpage | firstsection |
| topics | 0 | 1 | 0 | "General" | "Section 2" | "Section 1" |
| topics | 1 | 1 | 0 | "General" | "Section 2" | "Section 1" |
| topics | 0 | 1 | 1 | "Section 1" | "Section 2" | "Section 1" |
| topics | 1 | 1 | 1 | "Section 1" | "Section 2" | "Section 1" |
| weeks | 0 | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | 0 | "General" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 0 | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
| weeks | 1 | 0 | 1 | "1 January - 7 January" | "8 January - 14 January" | "1 January - 7 January" |
@javascript
Scenario Outline: Indentation should allow one level only
+9 -6
View File
@@ -10,15 +10,18 @@ Feature: Teacher can change the course format
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
# 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 ## |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| startdate | ## 1 day ago ## |
| initsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
# Confirm that course format is Topics
# Confirm that course format is Custom sections.
When I am on the "Course 1" course page logged in as teacher1
Then I should see "Topic 1"
Then I should see "Section 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Fields that appear for Custom sections format exist
@@ -44,7 +47,7 @@ Feature: Teacher can change the course format
And I press "Save and display"
# Confirm that course page displays single activity of type Glossary
And I should see "Browse the glossary using this index"
And I should not see "Topic 1"
And I should not see "Section 1"
And I am on the "Course 1" "course editing" page
And I expand all fieldsets
# Set course format.
@@ -1,8 +1,8 @@
@core @core_course
Feature: Site home topic section
Feature: Site home activities section
In order to show a display activities in the frontpage
As an admin
I need to edit the frontpage topic section
I need to edit the frontpage section
Background:
Given the following config values are set as admin:
@@ -17,7 +17,7 @@ Feature: Site home topic section
Then I should see "Frontpage assignment" in the "region-main" "region"
@javascript
Scenario: Topic name does appears in frontpage
Scenario: Section name does appears in frontpage
Given the following "activities" exist:
| activity | course | section | name | intro | idnumber |
| assign | Acceptance test site | 1 | Frontpage assignment | Assignment description | assign0 |
@@ -33,7 +33,7 @@ Feature: Site home topic section
And I should see "New section name" in the "region-main" "region"
@javascript
Scenario: Topic description appears in the frontpage
Scenario: Section description appears in the frontpage
Given I log in as "admin"
And I am on site homepage
And I turn editing mode on
+18 -14
View File
@@ -18,29 +18,33 @@ Feature: The maximum number of weeks/topics in a course can be configured
Scenario: The number of sections can be increased and the limits are applied to courses
Given I set the field "Maximum number of sections" to "100"
When I press "Save changes"
Then the field "Maximum number of sections" matches value "100"
And the field "Maximum number of sections" matches value "100"
And the "Number of sections" select box should contain "100"
And I log out
And I log in as "manager1"
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
| Number of sections | 90 |
| Format | Custom sections |
And I should see "Topic 90"
And the following "course" exists:
| fullname | New course fullname |
| shortname | New course shortname |
| format | topics |
| numsections | 90 |
| initsections | 1 |
And I am on the "New course fullname" course page
Then I should see "Section 90"
@javascript
Scenario: The number of sections can be reduced to 0 and the limits are applied to courses
Given I set the field "Maximum number of sections" to "0"
When I press "Save changes"
Then the field "Maximum number of sections" matches value "0"
And the field "Maximum number of sections" matches value "0"
And the "Number of sections" select box should contain "0"
And the "Number of sections" select box should not contain "52"
And I log out
And I log in as "manager1"
And I create a course with:
| Course full name | New course fullname |
| Course short name | New course shortname |
| Number of sections | 0 |
| Format | Custom sections |
And I should not see "Topic 1"
And the following "course" exists:
| fullname | New course fullname |
| shortname | New course shortname |
| format | topics |
| numsections | 0 |
| initsections | 1 |
And I am on the "New course fullname" course page
Then I should not see "Section 1"
+13 -9
View File
@@ -8,9 +8,13 @@ Feature: Activities can be moved between sections
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| coursedisplay | 0 |
| numsections | 5 |
| initsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -23,8 +27,8 @@ Feature: Activities can be moved between sections
Scenario: Move activities in a single page course with Javascript disabled
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Then I should see "Test forum name" in the "Section 2" "section"
And I should not see "Test forum name" in the "Section 1" "section"
Scenario: Move activities in the course home with Javascript disabled using paged mode
Given I navigate to "Settings" in current page administration
@@ -32,19 +36,19 @@ Feature: Activities can be moved between sections
| Course layout | Show one section per page |
And I press "Save and display"
When I move "Test forum name" activity to section "2"
Then I should see "Test forum name" in the "Topic 2" "section"
And I should not see "Test forum name" in the "Topic 1" "section"
Then I should see "Test forum name" in the "Section 2" "section"
And I should not see "Test forum name" in the "Section 1" "section"
Scenario: Move activities in a course section with Javascript disabled using paged mode
Given I navigate to "Settings" in current page administration
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
And I follow "Topic 1"
And I follow "Section 1"
When I move "Second forum name" activity to section "1"
Then "Second forum name" "link" should appear before "Test forum name" "link"
@javascript
Scenario: Move activity with javascript
When I move "Test forum name" activity to section "3"
Then I should see "Test forum name" in the "Topic 3" "section"
Then I should see "Test forum name" in the "Section 3" "section"
+22 -13
View File
@@ -8,9 +8,13 @@ Feature: Sections can be moved
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format | coursedisplay | numsections |
| Course 1 | C1 | topics | 0 | 5 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| coursedisplay | 0 |
| numsections | 5 |
|initsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -22,9 +26,11 @@ Feature: Sections can be moved
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I move down section "1"
Then I should see "Test forum name" in the "Topic 2" "section"
Then "Section 1" "section" should appear after "Section 2" "section"
And I should see "Test forum name" in the "Section 1" "section"
And I move up section "2"
And I should see "Test forum name" in the "Topic 1" "section"
And "Section 2" "section" should appear after "Section 1" "section"
And I should see "Test forum name" in the "Section 1" "section"
Scenario: Move up and down a section with Javascript disabled in the course home of a course using paged mode
Given I log in as "teacher1"
@@ -34,9 +40,11 @@ Feature: Sections can be moved
| Course layout | Show one section per page |
And I press "Save and display"
When I move down section "1"
Then I should see "Test forum name" in the "Topic 2" "section"
Then "Section 1" "section" should appear after "Section 2" "section"
And I should see "Test forum name" in the "Section 1" "section"
And I move up section "2"
And I should see "Test forum name" in the "Topic 1" "section"
And "Section 2" "section" should appear after "Section 1" "section"
And I should see "Test forum name" in the "Section 1" "section"
Scenario: Sections can not be moved with Javascript disabled in a section page of a course using paged mode
Given I am on the "Course 1" course page logged in as "teacher1"
@@ -44,10 +52,10 @@ Feature: Sections can be moved
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I click on "Topic 2" "link" in the "region-main" "region"
When I click on "Section 2" "link" in the "region-main" "region"
And I turn editing mode on
Then "Topic 1" "section" should not exist
And "Topic 3" "section" should not exist
Then "Section 1" "section" should not exist
And "Section 3" "section" should not exist
And "Move down" "link" should not exist
And "Move up" "link" should not exist
@@ -56,6 +64,7 @@ Feature: Sections can be moved
Given I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
When I open section "1" edit menu
And I click on "Move" "link" in the "Topic 1" "section"
And I click on "Topic 3" "link" in the ".modal-body" "css_element"
Then I should see "Test forum name" in the "Topic 3" "section"
And I click on "Move" "link" in the "Section 1" "section"
And I click on "Section 3" "link" in the ".modal-body" "css_element"
Then "Section 1" "section" should appear after "Section 3" "section"
And I should see "Test forum name" in the "Section 1" "section"
@@ -7,8 +7,8 @@ Feature: Course paged mode
@javascript @_cross_browser
Scenario Outline: Weekly and topics course formats with Javascript enabled
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 2 | 0 |
| fullname | shortname | category | format | coursedisplay | numsections | startdate | initsections |
| Course 1 | C1 | 0 | <courseformat> | 1 | 2 | 0 | <initsections> |
And I log in as "admin"
And I am on "Course 1" course homepage
And I click on <section1> "link" in the <section1> "section"
@@ -30,15 +30,15 @@ Feature: Course paged mode
And I should not see <nextunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | general | section1 | section2 | prevunexistingsection | nextunexistingsection |
| topics | "General" | "Topic 1" | "Topic 2" | "Topic 0" | "Topic 3" |
| weeks | "General" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" | "15 January - 21 January" |
| courseformat | initsections | general | section1 | section2 | prevunexistingsection | nextunexistingsection |
| topics | 1 | "General" | "Section 1" | "Section 2" | "Section 0" | "Section 3" |
| weeks | 0 | "General" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" | "15 January - 21 January" |
@javascript
Scenario Outline: Paged section redirect after creating an activity
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 | 0 |
| fullname | shortname | category | format | coursedisplay | numsections | startdate | initsections |
| Course 1 | C1 | 0 | <courseformat> | 1 | 3 | 0 | <initsections> |
And the following "activities" exist:
| activity | course | name |
| assign | C1 | Assignment |
@@ -52,14 +52,14 @@ Feature: Course paged mode
And I should not see <prevunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | courseandsection | section1 | section2 | prevunexistingsection |
| topics | "Course 1 > Topic 1" | "Topic 1" | "Topic 2" | "Topic 0" |
| weeks | "Course 1 > 1 January - 7 January" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" |
| courseformat | initsections | courseandsection | section1 | section2 | prevunexistingsection |
| topics | 1 | "Course 1 > Section 1" | "Section 1" | "Section 2" | "Section 0" |
| weeks | 0 | "Course 1 > 1 January - 7 January" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" |
Scenario Outline: Weekly and topics course formats with Javascript disabled
Given the following "courses" exist:
| fullname | shortname | category | format | coursedisplay | numsections | startdate |
| Course 1 | C1 | 0 | <courseformat> | 1 | 2 | 0 |
| fullname | shortname | category | format | coursedisplay | numsections | startdate | initsections |
| Course 1 | C1 | 0 | <courseformat> | 1 | 2 | 0 | <initsections> |
And I log in as "admin"
And I am on "Course 1" course homepage
Then I click on <section1> "link" in the <section1> "section"
@@ -81,6 +81,6 @@ Feature: Course paged mode
And I should not see <nextunexistingsection> in the ".single-section" "css_element"
Examples:
| courseformat | courseandsection1 | courseandsection2 | general | section1 | section2 | prevunexistingsection | nextunexistingsection |
| topics | "Course 1 > Topic 1" | "Course 1 > Topic 2" | "General" | "Topic 1" | "Topic 2" | "Topic 0" | "Topic 3" |
| weeks | "Course 1 > 1 January - 7 January" | "Course 1 > 8 January - 14 January" | "General" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" | "15 January - 21 January" |
| courseformat | initsections | courseandsection1 | courseandsection2 | general | section1 | section2 | prevunexistingsection | nextunexistingsection |
| topics | 1 | "Course 1 > Section 1" | "Course 1 > Section 2" | "General" | "Section 1" | "Section 2" | "Section 0" | "Section 3" |
| weeks | 0 | "Course 1 > 1 January - 7 January" | "Course 1 > 8 January - 14 January" | "General" | "1 January - 7 January" | "8 January - 14 January" | "25 December - 31 December" | "15 January - 21 January" |
+30 -25
View File
@@ -9,9 +9,14 @@ Feature: Show/hide course sections
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format | hiddensections | enablecompletion | coursedisplay |
| Course 1 | C1 | topics | 0 | 1 | 1 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| hiddensections | 0 |
| enablecompletion | 1 |
| coursedisplay | 1 |
| initsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -61,18 +66,18 @@ Feature: Show/hide course sections
And I set the following fields to these values:
| Course layout | Show one section per page |
And I press "Save and display"
When I click on "Topic 1" "link" in the "region-main" "region"
Then I should see "Topic 2" in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
When I click on "Section 1" "link" in the "region-main" "region"
Then I should see "Section 2" in the "region-main" "region"
And I click on "Section 2" "link" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I am on the "Course 1" course page logged in as student1
And I click on "Topic 1" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I click on "Topic 3" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I click on "Section 1" "link" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I click on "Section 3" "link" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
@javascript
Scenario: Students can not navigate to restricted sections
@@ -87,15 +92,15 @@ Feature: Show/hide course sections
| cm | Test label |
| Required completion status | must be marked complete |
And I press "Save changes"
When I click on "Topic 1" "link" in the "region-main" "region"
Then I should see "Topic 2" in the "region-main" "region"
And I click on "Topic 2" "link" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
When I click on "Section 1" "link" in the "region-main" "region"
Then I should see "Section 2" in the "region-main" "region"
And I click on "Section 2" "link" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I am on the "Course 1" course page logged in as student1
And I click on "Topic 1" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 3" in the "region-main" "region"
And I click on "Topic 3" "link" in the "region-main" "region"
And I should not see "Topic 2" in the "region-main" "region"
And I should see "Topic 1" in the "region-main" "region"
And I click on "Section 1" "link" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should see "Section 3" in the "region-main" "region"
And I click on "Section 3" "link" in the "region-main" "region"
And I should not see "Section 2" in the "region-main" "region"
And I should see "Section 1" in the "region-main" "region"
+1 -1
View File
@@ -372,7 +372,7 @@ class search_test extends \advanced_testcase {
$this->assertEquals($course->id, $doc->get('courseid'));
$this->assertFalse($doc->is_set('userid'));
$this->assertEquals(\core_search\manager::NO_OWNER_ID, $doc->get('owneruserid'));
$this->assertEquals('Topic 3', $doc->get('title'));
$this->assertEquals('New section', $doc->get('title'));
$this->assertEquals('Kermit', $doc->get('content'));
// Test with user-set title.
@@ -55,4 +55,4 @@ Feature: Requiredness The course custom fields can be mandatory or not
And I navigate to "Settings" in current page administration
And I press "Save and display"
Then I should see "Course 1"
And I should see "Topic 1"
And I should see "New section"
+1 -1
View File
@@ -57,7 +57,7 @@ Feature: Uniqueness The course custom fields can be mandatory or not
| Test field | testcontent |
And I press "Save and display"
Then I should not see "This value is already used"
And I should see "Topic 1"
And I should see "New section"
Scenario: A course custom field with unique data must allow empty data
When I log in as "teacher1"
+1 -1
View File
@@ -39,6 +39,6 @@ Feature: Users can be defined as key holders in courses where self enrolment is
And I set the following fields to these values:
| Enrolment key | moodle_rules |
And I press "Enrol me"
Then I should see "Topic 1"
Then I should see "New section"
And I should not see "Enrolment options"
And I should not see "Enrol me in this course"
@@ -38,7 +38,7 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I log in as "student1"
And I am on "Course 1" course homepage
And I press "Enrol me"
Then I should see "Topic 1"
Then I should see "New section"
And I should not see "Enrolment options"
Scenario: Self-enrolment enabled requiring an enrolment key
@@ -52,7 +52,7 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I set the following fields to these values:
| Enrolment key | moodle_rules |
And I press "Enrol me"
Then I should see "Topic 1"
Then I should see "New section"
And I should not see "Enrolment options"
And I should not see "Enrol me in this course"
@@ -79,7 +79,7 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I set the following fields to these values:
| Enrolment key | Test-groupenrolkey1 |
And I press "Enrol me"
Then I should see "Topic 1"
Then I should see "New section"
And I should not see "Enrolment options"
And I should not see "Enrol me in this course"
@@ -155,4 +155,4 @@ Feature: Users can auto-enrol themself in courses where self enrolment is allowe
And I am on "Course 1" course homepage
And I navigate to "Enrol me in this course" in current page administration
And I click on "Enrol me" "button"
Then I should see "Topic 1"
Then I should see "New section"
+32 -11
View File
@@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Data generator.
*
* @package core
* @category test
* @copyright 2012 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
@@ -357,9 +348,10 @@ EOD;
/**
* Create a test course
* @param array|stdClass $record
* @param array|stdClass $record Apart from the course information, the following can be also set:
* 'initsections' => bool for section name initialization, renaming them to "Section X". Default value is 0 (false).
* @param array $options with keys:
* 'createsections'=>bool precreate all sections
* 'createsections' => bool precreate all sections
* @return stdClass course record
*/
public function create_course($record=null, array $options=null) {
@@ -427,12 +419,41 @@ EOD;
}
}
$initsections = !empty($record['initsections']);
unset($record['initsections']);
$course = create_course((object)$record);
if ($initsections) {
$this->init_sections($course);
}
context_course::instance($course->id);
return $course;
}
/**
* Initializes sections for a specified course, such as configuring section names for courses using 'Section X'.
*
* @param stdClass $course The course object.
*/
private function init_sections(stdClass $course): void {
global $DB;
$sections = $DB->get_records('course_sections', ['course' => $course->id], 'section');
foreach ($sections as $section) {
if ($section->section != 0) {
$DB->set_field(
table: 'course_sections',
newfield: 'name',
newvalue: get_string('section', 'core') . ' ' . $section->section,
conditions: [
'id' => $section->id,
],
);
}
}
}
/**
* Create course section if does not exist yet
* @param array|stdClass $record must contain 'course' and 'section' attributes
@@ -23,6 +23,7 @@ namespace core;
* @category phpunit
* @copyright 2012 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \core\testing_data_generator
*/
class testing_generator_test extends \advanced_testcase {
public function test_get_plugin_generator_good_case() {
@@ -168,6 +169,7 @@ class testing_generator_test extends \advanced_testcase {
$section = $generator->create_course_section(array('course'=>$course->id, 'section'=>3));
$this->assertEquals($course->id, $section->course);
$this->assertNull($section->name);
$course = $generator->create_course(array('tags' => 'Cat, Dog'));
$this->assertEquals(array('Cat', 'Dog'), array_values(\core_tag_tag::get_item_tags_array('core', 'course', $course->id)));
@@ -176,6 +178,40 @@ class testing_generator_test extends \advanced_testcase {
$this->assertNotEmpty($scale);
}
/**
* Test case for the `test_create_course_initsections` method.
*
* This method tests the behavior of creating a course with initialized sections.
* It checks that the sections are renamed to "Section x" when `initsections` is true,
* and that the sections are not renamed when `initsections` is false.
*
* @covers ::create_course
*/
public function test_create_course_initsections(): void {
global $DB;
$this->resetAfterTest(true);
$generator = $this->getDataGenerator();
// Check that the sections are renamed to "Section x" when initsections is true.
$course = $generator->create_course(['initsections' => 1]);
$sections = course_get_format($course)->get_sections();
foreach ($sections as $section) {
if ($section->sectionnum > 0) {
$this->assertEquals(get_string('section') . ' ' . $section->sectionnum, $section->name);
}
}
// Check that the sections are not renamed when initsections is false.
$course = $generator->create_course(['initsections' => 0]);
$sections = course_get_format($course)->get_sections();
foreach ($sections as $section) {
if ($section->sectionnum > 0) {
$this->assertNull($section->name);
}
}
}
public function test_create_module() {
global $CFG, $SITE, $DB;
+7 -5
View File
@@ -9,9 +9,11 @@ Feature: In a book, create chapters and sub chapters
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -52,8 +54,8 @@ Feature: In a book, create chapters and sub chapters
And I should see "2. Dummy second chapter" in the "strong" "css_element"
And I should not see "Next" in the ".book_content" "css_element"
And I am on "Course 1" course homepage
And I should see "Test book" in the "Topic 1" "section"
And I click on "Test book" "link" in the "Topic 1" "section"
And I should see "Test book" in the "New section" "section"
And I click on "Test book" "link" in the "New section" "section"
And I should not see "Previous" in the ".book_content" "css_element"
And I should see "1. Dummy first chapter" in the "strong" "css_element"
When I click on "Next" "link"
+14 -11
View File
@@ -8,9 +8,12 @@ Feature: Manage course tools
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| category | 0 |
| format | topics |
| numsections | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -166,7 +169,7 @@ Feature: Manage course tools
| teacher1 | C2 | editingteacher |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
@@ -176,7 +179,7 @@ Feature: Manage course tools
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
And I click on "Show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
@@ -184,7 +187,7 @@ Feature: Manage course tools
# Should not affect other courses.
And I am on "Course 2" course homepage
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
@@ -195,7 +198,7 @@ Feature: Manage course tools
And I click on "Show in activity chooser" "field" in the "Teaching Tool 1" "table_row"
And I click on "Don't show in activity chooser" "field" in the "Teaching Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Teaching Tool 3" in the ".modal-body" "css_element"
@@ -216,7 +219,7 @@ Feature: Manage course tools
| Course Tool 2 | /mod/lti/tests/fixtures/tool_provider.php | C1 | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Course Tool 1" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
@@ -224,7 +227,7 @@ Feature: Manage course tools
And I click on "Don't show in activity chooser" "field" in the "Course Tool 1" "table_row"
And I click on "Show in activity chooser" "field" in the "Course Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should not see "Course Tool 1" in the ".modal-body" "css_element"
And I should see "Course Tool 2" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-dialog" "css_element"
@@ -232,7 +235,7 @@ Feature: Manage course tools
And I click on "Show in activity chooser" "field" in the "Course Tool 1" "table_row"
And I click on "Don't show in activity chooser" "field" in the "Course Tool 2" "table_row"
And I am on "Course 1" course homepage
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
And I should see "Course Tool 1" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
@@ -274,7 +277,7 @@ Feature: Manage course tools
And I restore "test_backup.mbz" backup into a new course using this options:
| Schema | Course name | Restored course |
And I should see "Restored course"
And I click on "Add an activity or resource" "button" in the "Topic 1" "section"
And I click on "Add an activity or resource" "button" in the "New section" "section"
Then I should not see "Teaching Tool 1" in the ".modal-body" "css_element"
And I should see "Teaching Tool 2" in the ".modal-body" "css_element"
And I should not see "Course Tool 2" in the ".modal-body" "css_element"
@@ -2,9 +2,13 @@
Feature: Teacher can view and filter activity completion data by group, activity type and section.
Background:
Given the following "courses" exist:
| fullname | shortname | format | enablecompletion | groupmode |
| Course 1 | C1 | topics | 1 | 1 |
Given the following "course" exists:
| fullname | Course 1 |
| shortname | C1 |
| format | topics |
| enablecompletion | 1 |
| groupmode | 1 |
| initsections | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | completion | completionview |
| quiz | My quiz B | A3 desc | C1 | quizb | 0 | 2 | 1 |
@@ -53,7 +57,7 @@ Feature: Teacher can view and filter activity completion data by group, activity
And I should not see "Student Two" in the "completion-progress" "table"
And I set the field "Separate groups" to "All participants"
And I set the field "Include" to "All activities and resources"
And I set the field "Section" to "Topic 1"
And I set the field "Section" to "Section 1"
And I should not see "My assignment" in the "completion-progress" "table"
And I should not see "My page" in the "completion-progress" "table"
And I should not see "My assignment" in the "completion-progress" "table"
@@ -61,10 +65,10 @@ Feature: Teacher can view and filter activity completion data by group, activity
And I should see "My quiz A" in the "completion-progress" "table"
And I should see "Quiz" in the "activityinclude" "select"
And I should not see "Page" in the "activityinclude" "select"
And I set the field "Section" to "Topic 2"
And I set the field "Section" to "Section 2"
And I should not see "Quiz" in the "activityinclude" "select"
And I should see "Page" in the "activityinclude" "select"
And I should see "Assignment" in the "activityinclude" "select"
And I set the field "Include" to "Page"
And I set the field "Section" to "Topic 1"
And I set the field "Section" to "Section 1"
And I should see "Page" in the "activityinclude" "select"