diff --git a/admin/tool/behat/tests/behat/edit_permissions.feature b/admin/tool/behat/tests/behat/edit_permissions.feature index 71f789ff59a49..b17c34bde087f 100644 --- a/admin/tool/behat/tests/behat/edit_permissions.feature +++ b/admin/tool/behat/tests/behat/edit_permissions.feature @@ -48,16 +48,12 @@ Feature: Edit capabilities And "mod/forum:addquestion" capability has "Allow" permission Scenario: Module capabilities overrides - Given I log in as "teacher1" - And the following "activity" exists: + Given the following "activity" exists: | activity | forum | | course | C1 | | idnumber | 00001 | | name | I'm the name | - | intro | I'm the introduction | - | section | 1 | - And I am on "Course 1" course homepage with editing mode on - And I follow "I'm the name" + And I am on the "I'm the name" "forum activity" page logged in as teacher1 And I navigate to "Permissions" in current page administration And I override the system permissions of "Student" role with: | mod/forum:deleteanypost | Prohibit | diff --git a/admin/tool/usertours/tests/behat/tour_filter.feature b/admin/tool/usertours/tests/behat/tour_filter.feature index fb59a64f0505c..b4b8514a2a4a3 100644 --- a/admin/tool/usertours/tests/behat/tour_filter.feature +++ b/admin/tool/usertours/tests/behat/tour_filter.feature @@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour | Course 1 | C1 | topics | 1 | | Course 2 | C2 | topics | 1 | And the following "activities" exist: - | activity | course | name | firstpagetitle | wikimode | - | wiki | C1 | Test wiki name | First page | collaborative | + | activity | course | name | firstpagetitle | wikimode | idnumber | intro | type | + | wiki | C1 | Test wiki name | First page | collaborative | | | | + | forum | C2 | Test forum name | | | 001 | Test forum description | general | And I log in as "admin" - And I am on "Course 2" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Forum type | Standard forum for general use | - | Description | Test forum description | And I add a new user tour with: | Name | Wiki tour | | Description | A tour with both matches | diff --git a/availability/condition/completion/tests/behat/availability_completion.feature b/availability/condition/completion/tests/behat/availability_completion.feature index 2ac194962866d..48b7c54843190 100644 --- a/availability/condition/completion/tests/behat/availability_completion.feature +++ b/availability/condition/completion/tests/behat/availability_completion.feature @@ -58,21 +58,18 @@ Feature: availability_completion @javascript Scenario: Test completion and course cache rebuild Given the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | forum 1 | forum 1 | C1 | forum1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I open "forum 1" actions menu - And I click on "Edit settings" "link" in the "forum 1" activity + | activity | name | course | idnumber | + | forum | forum 1 | C1 | forum1 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | student1 | forum 1 | Forum posst 1 | This is the body | + And I am on the "forum 1" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: | Completion tracking | Show activity as complete when conditions are met | | completionview | 1 | | completionpostsenabled | 1 | | completionposts | 2 | And I press "Save and return to course" - And I add a new discussion to "forum 1" forum with: - | Subject | Forum post 1 | - | Message | This is the body | And I am on "Course 1" course homepage with editing mode on And I add a "Page" to section "2" And I set the following fields to these values: @@ -87,25 +84,18 @@ Feature: availability_completion | Required completion status | must be marked complete | | cm | forum 1 | And I press "Save and return to course" - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 # Page 2 should not appear yet. Then I should not see "Page 2" in the "region-main" "region" And I click on "forum 1" "link" in the "region-main" "region" # Page 2 should not appear yet. And I should not see "Page 2" in the "region-main" "region" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I am on the "forum 1" "forum activity editing" page + And I am on the "forum 1" "forum activity editing" page logged in as teacher1 And I expand all fieldsets And I set the following fields to these values: | completionpostsenabled | 0 | And I press "Save and display" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I click on "forum 1" "link" in the "region-main" "region" And I am on "Course 1" course homepage And I should see "Page 2" in the "region-main" "region" diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index d88bd12c33a6c..2e6089a57832f 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -27,6 +27,10 @@ Feature: edit_availability | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | name | MyForum | Scenario: Confirm the 'enable availability' option is working Given the following config values are set as admin: @@ -178,9 +182,7 @@ Feature: edit_availability # Button does not exist when conditional access restrictions are turned off. Given the following config values are set as admin: | enableavailability | 0 | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" + And I am on the "MyForum" "forum activity editing" page logged in as admin When I expand all fieldsets Then "Add group/grouping access restriction" "button" should not exist @@ -190,12 +192,7 @@ Feature: edit_availability Given the following "groupings" exist: | name | course | idnumber | | GX1 | C1 | GXI1 | - And I log in as "admin" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" - And I set the following fields to these values: - | Forum name | MyForum | - | Description | x | + And I am on the "MyForum" "forum activity editing" page logged in as admin When I expand all fieldsets Then the "Add group/grouping access restriction" "button" should be disabled diff --git a/backup/util/ui/tests/behat/restore_moodle2_courses.feature b/backup/util/ui/tests/behat/restore_moodle2_courses.feature index f14bf80cfe800..e04c22c73ff0e 100644 --- a/backup/util/ui/tests/behat/restore_moodle2_courses.feature +++ b/backup/util/ui/tests/behat/restore_moodle2_courses.feature @@ -12,15 +12,13 @@ Feature: Restore Moodle 2 course backups | Course 3 | C3 | 0 | topics | 2 | 0 | | Course 4 | C4 | 0 | topics | 20 | 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 | | - | url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org | + | 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 | And I log in as "admin" And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | And I add the "Activities" block @javascript @@ -63,10 +61,11 @@ Feature: Restore Moodle 2 course backups Scenario: Restore a backup into the same course removing it's contents before that When I backup "Course 1" course using this options: | Confirmation | Filename | test_backup.mbz | - And I am on "Course 1" course homepage - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum post backup name | - | Description | Test forum post backup description | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | section | 1 | + | name | Test forum post backup name | And I am on the "Course 1" "restore" page And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options: | Schema | Section 3 | 0 | diff --git a/blocks/navigation/tests/behat/participants_link.feature b/blocks/navigation/tests/behat/participants_link.feature index a66edbcdd0c1b..046cd8e927d55 100644 --- a/blocks/navigation/tests/behat/participants_link.feature +++ b/blocks/navigation/tests/behat/participants_link.feature @@ -39,19 +39,15 @@ Feature: Displaying the link to the Participants page @javascript Scenario: Course participants link is displayed to users depending on role permissions settings - And I log in as "admin" - And I am on "Course1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | - And I am on the "Course1" "enrolment methods" page + Given the following "activities" exist: + | activity | course | name | + | forum | C1 | Test forum name | + And I am on the "Course1" "enrolment methods" page logged in as admin And I click on "Edit" "link" in the "Guest access" "table_row" And I set the following fields to these values: | Allow guest access | Yes | And I press "Save changes" - And I log out - When I log in as "guest" - And I am on "Course1" course homepage + When I am on the "Course1" course page logged in as guest Then I should not see "Participants" in the "Navigation" "block" And I am on the "Test forum name" "forum activity" page And I should not see "Participants" in the "Navigation" "block" @@ -60,8 +56,7 @@ Feature: Displaying the link to the Participants page And I set the following system permissions of "Guest" role: | capability | permission | | moodle/course:viewparticipants | Allow | - And I log in as "guest" - And I am on "Course1" course homepage + And I am on the "Course1" course page logged in as guest And I should see "Participants" in the "Navigation" "block" And I am on the "Test forum name" "forum activity" page And I should see "Participants" in the "Navigation" "block" diff --git a/blocks/recent_activity/tests/behat/structural_changes.feature b/blocks/recent_activity/tests/behat/structural_changes.feature index d0e2feb8571ca..dc52bb0fa074e 100644 --- a/blocks/recent_activity/tests/behat/structural_changes.feature +++ b/blocks/recent_activity/tests/behat/structural_changes.feature @@ -47,38 +47,33 @@ Feature: View structural changes in recent activity block Scenario: Check that Added module information is displayed respecting view capability Given the following "activities" exist: - | activity | course | section | name | idnumber | description | groupmode | grouping | visible | - | forum | C1 | 1 | ForumVisibleGroups | forum1 | No description | 2 | | 1 | - | forum | C1 | 1 | ForumSeparateGroups | forum2 | No description | 1 | | 1 | - | forum | C1 | 1 | ForumHidden | forum3 | No description | 1 | | 0 | - | forum | C1 | 1 | ForumNoGroups | forum4 | No description | 0 | | 1 | - | forum | C1 | 2 | ForumVisibleGroupsG1 | forum5 | No description | 2 | GG1 | 1 | - | forum | C1 | 2 | ForumSeparateGroupsG1 | forum6 | No description | 1 | GG1 | 1 | - | forum | C1 | 3 | ForumVisibleGroupsG2 | forum7 | No description | 2 | GG2 | 1 | - | forum | C1 | 3 | ForumSeparateGroupsG2 | forum8 | No description | 1 | GG2 | 1 | - And I log in as "teacher1" - - And I am on "Course 1" course homepage - And I click on "ForumVisibleGroupsG1" "link" - And I click on "Settings" "link" + | activity | course | name | idnumber | groupmode | grouping | visible | + | forum | C1 | ForumVisibleGroups | forum1 | 2 | | 1 | + | forum | C1 | ForumSeparateGroups | forum2 | 1 | | 1 | + | forum | C1 | ForumHidden | forum3 | 1 | | 0 | + | forum | C1 | ForumNoGroups | forum4 | 0 | | 1 | + | forum | C1 | ForumVisibleGroupsG1 | forum5 | 2 | GG1 | 1 | + | forum | C1 | ForumSeparateGroupsG1 | forum6 | 1 | GG1 | 1 | + | forum | C1 | ForumVisibleGroupsG2 | forum7 | 2 | GG2 | 1 | + | forum | C1 | ForumSeparateGroupsG2 | forum8 | 1 | GG2 | 1 | + + And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: | Access restrictions | Grouping: Grouping 1 | And I press "Save and return to course" - And I click on "ForumSeparateGroupsG1" "link" - And I click on "Settings" "link" + And I am on the "ForumSeparateGroupsG1" "forum activity editing" page And I set the following fields to these values: | Access restrictions | Grouping: Grouping 1 | And I press "Save and return to course" - And I click on "ForumVisibleGroupsG2" "link" - And I click on "Settings" "link" + And I am on the "ForumVisibleGroupsG2" "forum activity editing" page And I set the following fields to these values: | Access restrictions | Grouping: Grouping 2 | And I press "Save and return to course" - And I click on "ForumSeparateGroupsG2" "link" - And I click on "Settings" "link" + And I am on the "ForumSeparateGroupsG2" "forum activity editing" page + And I set the following fields to these values: | Access restrictions | Grouping: Grouping 2 | And I press "Save and return to course" @@ -94,10 +89,8 @@ Feature: View structural changes in recent activity block And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block" And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block" And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "ForumVisibleGroups" in the "Recent activity" "block" And I should see "ForumSeparateGroups" in the "Recent activity" "block" And I should see "ForumNoGroups" in the "Recent activity" "block" @@ -106,10 +99,8 @@ Feature: View structural changes in recent activity block And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block" And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block" And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I should see "ForumVisibleGroups" in the "Recent activity" "block" And I should see "ForumSeparateGroups" in the "Recent activity" "block" And I should see "ForumNoGroups" in the "Recent activity" "block" @@ -118,10 +109,8 @@ Feature: View structural changes in recent activity block And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block" And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block" And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should see "ForumVisibleGroups" in the "Recent activity" "block" And I should see "ForumSeparateGroups" in the "Recent activity" "block" And I should see "ForumNoGroups" in the "Recent activity" "block" @@ -130,17 +119,14 @@ Feature: View structural changes in recent activity block And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block" And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block" And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block" - And I log out # Teachers have capability to see all groups and hidden activities - And I log in as "assistant1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as assistant1 And I should see "ForumHidden" in the "Recent activity" "block" And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block" And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block" And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block" And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block" - And I log out Scenario: Updates and deletes in recent activity block Given the following "activity" exists: @@ -148,7 +134,6 @@ Feature: View structural changes in recent activity block | course | C1 | | idnumber | forum1 | | name | ForumNew | - | description | No description | When I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add the "Recent activity" block @@ -158,8 +143,7 @@ Feature: View structural changes in recent activity block # Update forum as a teacher after a second to ensure we have a new timestamp for recent activity. And I wait "1" seconds - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Added Forum" in the "Recent activity" "block" And I should see "ForumNew" in the "Recent activity" "block" And I log out @@ -167,10 +151,7 @@ Feature: View structural changes in recent activity block And I wait "1" seconds # Update forum as a teacher - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "ForumNew" - And I navigate to "Settings" in current page administration + And I am on the "ForumNew" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: | name | ForumUpdated | And I press "Save and return to course" @@ -178,8 +159,7 @@ Feature: View structural changes in recent activity block And I wait "1" seconds # Student 1 already saw that forum was created, now he can see that forum was updated - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should not see "Added Forum" in the "Recent activity" "block" And I should not see "ForumNew" in the "Recent activity" "block" And I should see "Updated Forum" in the "Recent activity" "block" @@ -188,8 +168,7 @@ Feature: View structural changes in recent activity block And I wait "1" seconds # Student 2 has bigger interval and he can see one entry that forum was created but with the new name - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I should see "Added Forum" in the "Recent activity" "block" And I should not see "ForumNew" in the "Recent activity" "block" And I should not see "Updated Forum" in the "Recent activity" "block" @@ -206,8 +185,7 @@ Feature: View structural changes in recent activity block And I wait "1" seconds # Students 1 and 2 see that forum was deleted - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should not see "Added Forum" in the "Recent activity" "block" And I should not see "ForumNew" in the "Recent activity" "block" And I should not see "Updated Forum" in the "Recent activity" "block" @@ -217,8 +195,7 @@ Feature: View structural changes in recent activity block And I wait "1" seconds # Student 3 never knew that forum was created, so he does not see anything - And I log in as "student3" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student3 And I should not see "Added Forum" in the "Recent activity" "block" And I should not see "ForumNew" in the "Recent activity" "block" And I should not see "Updated Forum" in the "Recent activity" "block" diff --git a/blocks/site_main_menu/tests/behat/edit_activities.feature b/blocks/site_main_menu/tests/behat/edit_activities.feature index e19c4ea51d5e5..45d5014340849 100644 --- a/blocks/site_main_menu/tests/behat/edit_activities.feature +++ b/blocks/site_main_menu/tests/behat/edit_activities.feature @@ -26,14 +26,16 @@ Feature: Edit activities in main menu block Scenario: Activities in main menu block can be made available but not visible on a course page Given the following config values are set as admin: | allowstealth | 1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | pagetypepattern | defaultregion | + | site_main_menu | System | 1 | site-index | side-post | + And the following "activities" exist: + | activity | course | section | name | + | forum | Acceptance test site | 0 | Visible forum | + | forum | Acceptance test site | 0 | My forum name | And I log in as "admin" And I am on site homepage And I turn editing mode on - And I add the "Main menu" block - When I add a "Forum" to section "0" and I fill the form with: - | Forum name | Visible forum | - When I add a "Forum" to section "0" and I fill the form with: - | Forum name | My forum name | And "My forum name" activity in site main menu block should have "Hide" editing icon And "My forum name" activity in site main menu block should not have "Show" editing icon And "My forum name" activity in site main menu block should not have "Make available" editing icon diff --git a/blocks/social_activities/tests/behat/edit_activities.feature b/blocks/social_activities/tests/behat/edit_activities.feature index 2fdf554d0c134..8a63dd36fc85f 100644 --- a/blocks/social_activities/tests/behat/edit_activities.feature +++ b/blocks/social_activities/tests/behat/edit_activities.feature @@ -19,12 +19,11 @@ Feature: Edit activities in social activities block @javascript Scenario: Edit name of activity in-place in social activities block - Given I log in as "user1" + Given the following "activities" exist: + | activity | course | name | + | forum | C1 | My forum name | + And I log in as "user1" And I am on "Course 1" course homepage with editing mode on - And I press "Add an activity or resource" - And I click on "Add a new Forum" "link" in the "Add an activity or resource" "dialogue" - And I set the field "Forum name" to "My forum name" - And I press "Save and return to course" When I set the field "Edit title" in the "My forum name" "block_social_activities > Activity" to "New forum name" Then I should not see "My forum name" in the "Social activities" "block" And I should see "New forum name" diff --git a/completion/tests/behat/completion_course_page_display.feature b/completion/tests/behat/completion_course_page_display.feature index cf68afe9388c5..f09e80247884f 100644 --- a/completion/tests/behat/completion_course_page_display.feature +++ b/completion/tests/behat/completion_course_page_display.feature @@ -24,27 +24,20 @@ Feature: Show activity completion status or activity completion configuration on And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" - And the following "activities" exist: - | activity | course | idnumber | name | intro | completion | completionview | completionexpected | - | forum | C1 | forum1 | Test forum name | Test forum description | 1 | 0 | 0 | And the following "activities" exist: | activity | course | idnumber | name | intro | completion | completionview | completionexpected | | assign | C1 | assign1 | Test assignment name | Test assignment description | 2 | 1 | 0 | - And the following "activities" exist: - | activity | course | idnumber | name | intro | completion | completionview | completionexpected | - | quiz | C1 | quiz1 | Test quiz name | Test quiz description | 0 | 0 | 0 | - And I log out + | quiz | C1 | quiz1 | Test quiz name | Test quiz description | 0 | 0 | 0 | + | forum | C1 | forum1 | Test forum name | | 1 | 0 | 0 | Scenario: Show completion status to students - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 And the manual completion button of "Test forum name" is displayed as "Mark as done" And the "View" completion condition of "Test assignment name" is displayed as "todo" And there should be no completion information shown for "Test quiz name" Scenario: Show completion configuration to editing teachers - Given I log in as "teacher1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher1 And the manual completion button for "Test forum name" should be disabled And "Test assignment name" should have the "View" completion condition And there should be no completion information shown for "Test quiz name" @@ -54,8 +47,7 @@ Feature: Show activity completion status or activity completion configuration on And there should be no completion information shown for "Test quiz name" Scenario: Show completion configuration to non-editing teachers - Given I log in as "teacher2" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher2 And the manual completion button for "Test forum name" should be disabled And "Test assignment name" should have the "View" completion condition And there should be no completion information shown for "Test quiz name" diff --git a/completion/tests/behat/completion_no_calendar_capabilities.feature b/completion/tests/behat/completion_no_calendar_capabilities.feature index 3693bc6a14292..ae6ef9255bc72 100644 --- a/completion/tests/behat/completion_no_calendar_capabilities.feature +++ b/completion/tests/behat/completion_no_calendar_capabilities.feature @@ -19,13 +19,8 @@ Feature: Completion with no calendar capabilites | course | C1 | | idnumber | 00001 | | name | Test forum name | - | intro | Test forum name description | - | section | 1 | | completion | 2 | - And I log in as "admin" - And I am on "Course 1" course homepage - And I follow "Test forum name" - And I navigate to "Settings" in current page administration + And I am on the "Test forum name" "forum activity editing" page logged in as admin And I set the following fields to these values: | id_completionexpected_enabled | 1 | | id_completionexpected_day | 1 | @@ -36,13 +31,9 @@ Feature: Completion with no calendar capabilites And I override the system permissions of "Teacher" role with: | capability | permission | | moodle/calendar:manageentries | Prohibit | - And I log out Scenario: Editing completion date - When I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Test forum name" - And I navigate to "Settings" in current page administration + When I am on the "Test forum name" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: | id_completionexpected_year | 2018 | And I press "Save and return to course" diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index b86b01e5bedd6..3884daa329d1f 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -17,23 +17,22 @@ Feature: Allow students to manually mark an activity as complete | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on + And the following "activity" exists: + | activity | forum | + | course | C1 | + | name | Test forum name | + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Settings" in current page administration And I set the following fields to these values: | Enable completion tracking | Yes | And I press "Save and display" - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | - | Completion tracking | Students can manually mark the activity as completed | + And I am on the "Test forum name" "forum activity editing" page + And I set the following fields to these values: + | completion | 1 | + And I press "Save and return to course" And "Student First" user has not completed "Test forum name" activity - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 When I toggle the manual completion state of "Test forum name" Then the manual completion button of "Test forum name" is displayed as "Done" - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And "Student First" user has completed "Test forum name" activity diff --git a/course/tests/behat/activities_edit_name.feature b/course/tests/behat/activities_edit_name.feature index 54c2e755ebd4a..54d11a94095ee 100644 --- a/course/tests/behat/activities_edit_name.feature +++ b/course/tests/behat/activities_edit_name.feature @@ -18,7 +18,6 @@ Feature: Edit activity name in-place | course | C1 | | activity | forum | | name | Test forum name | - | description | Test forum description | | idnumber | forum1 | @javascript diff --git a/course/tests/behat/activities_visibility_icons.feature b/course/tests/behat/activities_visibility_icons.feature index f3eb05ddcaac3..acb3c69ce6161 100644 --- a/course/tests/behat/activities_visibility_icons.feature +++ b/course/tests/behat/activities_visibility_icons.feature @@ -27,7 +27,6 @@ Feature: Toggle activities visibility from the course page | course | C1 | | idnumber | C1F1 | | name | Test forum name | - | intro | Test forum description | | visible | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on @@ -63,10 +62,8 @@ Feature: Toggle activities visibility from the course page And "Test forum name" activity should be hidden And I turn editing mode off And "Test forum name" activity should be hidden - And I log out # Student should not see this activity. - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should not see "Test forum name" @javascript @@ -77,7 +74,6 @@ Feature: Toggle activities visibility from the course page | idnumber | C1F1 | | section | 2 | | name | Test forum name | - | intro | Test forum description | | visible | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on @@ -108,10 +104,8 @@ Feature: Toggle activities visibility from the course page And "Test forum name" activity should be available but hidden from course page And I turn editing mode off And "Test forum name" activity should be available but hidden from course page - And I log out # Student will not see the module on the course page but can access it from other reports and blocks: - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And "Test forum name" activity should be hidden And I click on "Test forum name" "link" in the "Recent activity" "block" And I should see "Test forum name" diff --git a/course/tests/behat/course_collapse_sections.feature b/course/tests/behat/course_collapse_sections.feature index ecda98465d238..52d4df3086820 100644 --- a/course/tests/behat/course_collapse_sections.feature +++ b/course/tests/behat/course_collapse_sections.feature @@ -24,8 +24,8 @@ Feature: Collapse course sections | assign | Assignment 2 | Test assignment description2 | C1 | assign2 | 2 | 1 | | book | Book 2 | | C1 | book2 | 2 | 1 | | book | Book 3 | | C1 | book3 | 3 | 1 | - | forum | Forum 4 | Test forum description4 | C1 | forum4 | 4 | 1 | - | forum | Forum 5 | Test forum description5 | C1 | forum5 | 5 | 1 | + | forum | Forum 4 | | C1 | forum4 | 4 | 1 | + | forum | Forum 5 | | C1 | forum5 | 5 | 1 | And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | @@ -40,16 +40,17 @@ Feature: Collapse course sections And I set the field "x[year]" to "2013" And I press "Save changes" And I hide section "5" - And I log out @javascript Scenario: No chevron on site home - Given I log in as "admin" + Given the following activity" exists: + | activity | forum | + | course | Acceptance test site | + | section | 1 | + | name | Test forum post backup name | + And I log in as "admin" And I am on site homepage And I turn editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum post backup name | - | Description | Test forum post backup description | And I click on "Edit summary" "link" in the "region-main" "region" And I click on "Custom" "checkbox" And I set the field "New value for Section name" to "New section name" @@ -143,8 +144,7 @@ Feature: Collapse course sections @javascript Scenario: Users don't see chevron on one section per page for Topics format - Given I log in as "teacher1" - And I am on "Course 1" course homepage + 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: @@ -165,8 +165,7 @@ Feature: Collapse course sections @javascript Scenario: Users don't see chevron on one section per page for Weeks format - Given I log in as "teacher1" - And I am on "Course 1" course homepage + 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: @@ -179,9 +178,7 @@ Feature: Collapse course sections And "[data-toggle=collapse]" "css_element" should not exist in the "region-main" "region" Then "1 May - 7 May" "section" should not exist And "15 May - 21 May" "section" should not exist - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "Available until" in the "#section-4 .availabilityinfo" "css_element" And I should see "2013" in the "#section-4 .availabilityinfo" "css_element" And I should not see "Forum 4" diff --git a/course/tests/behat/course_controls.feature b/course/tests/behat/course_controls.feature index f858d1c9aed44..ee33abdbe530c 100644 --- a/course/tests/behat/course_controls.feature +++ b/course/tests/behat/course_controls.feature @@ -26,6 +26,10 @@ Feature: Course activity controls works as expected And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | course | section | name | + | forum | C1 | 1 | Test forum name 1 | + | forum | C1 | 1 | Test forum name 2 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on When I click on "link" in the "region-main" "region" @@ -34,12 +38,6 @@ Feature: Course activity controls works as expected And I click on "Delete Recent activity block" "link" And I click on "Delete" "button" in the "Delete block?" "dialogue" And "section" exist - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name 1 | - | Description | Test forum description 1 | - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name 2 | - | Description | Test forum description 2 | And "section" exist And I open "Test forum name 1" actions menu And I click on "Edit settings" "link" in the "Test forum name 1" activity @@ -96,9 +94,9 @@ Feature: Course activity controls works as expected | user | course | role | | teacher1 | C1 | editingteacher | And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | forum | Test forum name 1 | Test forum description 1 | C1 | 0001 | 1 | - | forum | Test forum name 2 | Test forum description 2 | C1 | 0002 | 1 | + | activity | name | course | idnumber | section | + | forum | Test forum name 1 | C1 | 0001 | 1 | + | forum | Test forum name 2 | C1 | 0002 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on When I click on "link" in the "region-main" "region" diff --git a/course/tests/behat/general_section.feature b/course/tests/behat/general_section.feature index 09d82044961f1..32d3ef1b50095 100644 --- a/course/tests/behat/general_section.feature +++ b/course/tests/behat/general_section.feature @@ -15,8 +15,8 @@ Feature: General section does not show in navigation when empty | user | course | role | | teacher1 | C1 | editingteacher | And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | + | activity | name | course | idnumber | section | + | forum | Test forum name | C1 | forum1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And the following config values are set as admin: diff --git a/course/tests/behat/move_activities.feature b/course/tests/behat/move_activities.feature index 7e85daa515578..9920bf96850e0 100644 --- a/course/tests/behat/move_activities.feature +++ b/course/tests/behat/move_activities.feature @@ -14,13 +14,10 @@ Feature: Activities can be moved between sections And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - And the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | 00001 | - | name | Test forum name | - | intro | Test forum description | - | section | 1 | + And the following "activities" exist: + | activity | name | course | idnumber | section | + | forum | Test forum name | C1 | 00001 | 1 | + | forum | Second forum name | C1 | 00002 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on @@ -40,13 +37,6 @@ Feature: Activities can be moved between sections Scenario: Move activities in a course section with Javascript disabled using paged mode Given I navigate to "Settings" in current page administration - And the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | 00002 | - | name | Second forum name | - | intro | Second forum description | - | section | 1 | And I set the following fields to these values: | Course layout | Show one section per page | And I press "Save and display" diff --git a/course/tests/behat/move_sections.feature b/course/tests/behat/move_sections.feature index e6087c170271d..b8c5164788ce6 100644 --- a/course/tests/behat/move_sections.feature +++ b/course/tests/behat/move_sections.feature @@ -15,8 +15,8 @@ Feature: Sections can be moved | user | course | role | | teacher1 | C1 | editingteacher | And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | + | activity | name | course | idnumber | section | + | forum | Test forum name | C1 | forum1 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on diff --git a/course/tests/behat/section_visibility.feature b/course/tests/behat/section_visibility.feature index 861417e8d815e..a47f07983eb43 100644 --- a/course/tests/behat/section_visibility.feature +++ b/course/tests/behat/section_visibility.feature @@ -16,36 +16,19 @@ Feature: Show/hide course sections | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | + And the following "activities" exist: + | activity | course | section | name | visible | + | forum | C1 | 1 | Test hidden forum 11 name | 0 | + | forum | C1 | 1 | Test hidden forum 12 name | 1 | + | forum | C1 | 2 | Test hidden forum 21 name | 0 | + | forum | C1 | 2 | Test hidden forum 22 name | 1 | + | forum | C1 | 3 | Test hidden forum 31 name | 0 | + | forum | C1 | 3 | Test hidden forum 32 name | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test hidden forum 11 name | - | Description | Test hidden forum 11 description | - | Availability | Hide on course page | - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test hidden forum 12 name | - | Description | Test hidden forum 12 description | - | Availability | Show on course page | - And I add a "Forum" to section "2" and I fill the form with: - | Forum name | Test hidden forum 21 name | - | Description | Test hidden forum 21 description | - | Availability | Hide on course page | - And I add a "Forum" to section "2" and I fill the form with: - | Forum name | Test hidden forum 22 name | - | Description | Test hidden forum 22 description | - | Availability | Show on course page | - And I add a "Forum" to section "3" and I fill the form with: - | Forum name | Test hidden forum 31 name | - | Description | Test hidden forum 31 description | - | Availability | Hide on course page | - And I add a "Forum" to section "3" and I fill the form with: - | Forum name | Test hidden forum 32 name | - | Description | Test hidden forum 32 description | - | Availability | Show on course page | @javascript Scenario: Show / hide section icon functions correctly - Given I am on "Course 1" course homepage When I hide section "1" Then section "1" should be hidden And section "2" should be visible @@ -64,9 +47,7 @@ Feature: Show/hide course sections And section "2" should be visible And section "3" should be hidden And all activities in section "1" should be hidden - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And section "1" should be hidden And all activities in section "1" should be hidden And section "2" should be visible @@ -75,9 +56,8 @@ Feature: Show/hide course sections @javascript Scenario: Students can not navigate to hidden sections - Given I am on "Course 1" course homepage - And I hide section "2" - Given I navigate to "Settings" in current page administration + Given I hide section "2" + And 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" @@ -86,9 +66,7 @@ Feature: Show/hide course sections 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" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + 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" @@ -98,7 +76,6 @@ Feature: Show/hide course sections @javascript Scenario: Students can not navigate to restricted sections - Given I am on "Course 1" course homepage 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 | @@ -120,9 +97,7 @@ Feature: Show/hide course sections 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" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + 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" diff --git a/course/tests/behat/sectionzero_title.feature b/course/tests/behat/sectionzero_title.feature index bd7032364ff79..d3599dba3a4a6 100644 --- a/course/tests/behat/sectionzero_title.feature +++ b/course/tests/behat/sectionzero_title.feature @@ -14,7 +14,7 @@ Feature: Section 0 default/custom title And the following "activities" exist: | activity | name | intro | course | idnumber | section | | data | Test database name | Test database description | C1 | database1 | 2 | - | forum | Test forum name | Test forum name description | C1 | forum1 | 1 | + | forum | Test forum name | | C1 | forum1 | 1 | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | diff --git a/enrol/guest/tests/behat/guest_access.feature b/enrol/guest/tests/behat/guest_access.feature index d8f1cc37fc4b0..ce8d696b198fe 100644 --- a/enrol/guest/tests/behat/guest_access.feature +++ b/enrol/guest/tests/behat/guest_access.feature @@ -20,22 +20,14 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al | course | C1 | | idnumber | 0001 | | name | Test forum name | - | intro | Test forum description | - | section | 1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I turn editing mode on - And I am on the "Course 1" "enrolment methods" page + And I am on the "Course 1" "enrolment methods" page logged in as teacher1 Scenario: Allow guest access without password Given I click on "Edit" "link" in the "Guest access" "table_row" And I set the following fields to these values: | Allow guest access | Yes | And I press "Save changes" - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should not see "Subscribe to this forum" Scenario: Allow guest access with password @@ -44,9 +36,7 @@ Feature: Guest users can auto-enrol themself in courses where guest access is al | Allow guest access | Yes | | Password | moodle_rules | And I press "Save changes" - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "Guest access" And I set the following fields to these values: | Password | moodle_rules | diff --git a/grade/tests/behat/grade_to_pass.feature b/grade/tests/behat/grade_to_pass.feature index 4a9f08c552078..0959ef893bb4d 100644 --- a/grade/tests/behat/grade_to_pass.feature +++ b/grade/tests/behat/grade_to_pass.feature @@ -242,11 +242,9 @@ Feature: We can set the grade to pass value Scenario: Set an invalid grade to pass for forum activity Given the following "activities" exist: - | activity | name | intro | course | section | idnumber | - | forum | Test Forum 1 | Test | C1 | 1 | forum1 | - And I am on "Course 1" course homepage with editing mode on - And I am on the "Test Forum 1" "forum activity" page - And I navigate to "Settings" in current page administration + | activity | name | course | idnumber | + | forum | Test Forum 1 | C1 | forum1 | + And I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets And I set the following fields to these values: | Ratings > Aggregate type | Average of ratings | @@ -258,11 +256,10 @@ Feature: We can set the grade to pass value Scenario: Set a valid grade to pass for forum activity Given the following "activities" exist: - | activity | name | intro | course | section | idnumber | - | forum | Test Forum 1 | Test | C1 | 1 | forum1 | + | activity | name | course | idnumber | + | forum | Test Forum 1 | C1 | forum1 | And I am on "Course 1" course homepage with editing mode on - And I am on the "Test Forum 1" "forum activity" page - And I navigate to "Settings" in current page administration + And I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets And I set the following fields to these values: | Ratings > Aggregate type | Average of ratings | @@ -276,9 +273,7 @@ Feature: We can set the grade to pass value Then the field "Grade to pass" matches value "90" And I set the field "Grade to pass" to "80" And I press "Save changes" - And I am on "Course 1" course homepage - And I am on the "Test Forum 1" "forum activity" page - And I follow "Settings" + And I am on the "Test Forum 1" "forum activity editing" page And the field "Ratings > Grade to pass" matches value "80" Scenario: Set a valid grade to pass for glossary activity diff --git a/lib/form/tests/behat/graderescale_for_forum_pointscale.feature b/lib/form/tests/behat/graderescale_for_forum_pointscale.feature index ac52ffa79268b..62a7c3f4d9fd3 100644 --- a/lib/form/tests/behat/graderescale_for_forum_pointscale.feature +++ b/lib/form/tests/behat/graderescale_for_forum_pointscale.feature @@ -20,17 +20,14 @@ Feature: Using the forum activities which support point scale | course | C1 | | activity | forum | | name | Test forum name | - | description | Test forum description | | idnumber | forum1 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | student1 | Test forum name | Discussion subject | Test post in forum 1 | @javascript Scenario: Forum rescale grade should not be possible when users are graded - Given I am on the "Course 1" course page logged in as student1 - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion subject | - | Message | Test post in forum 1 | - And I log out - And I am on the "Test forum name" "forum activity editing" page logged in as teacher1 + Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1 And I expand all fieldsets And I set the field "Ratings > Aggregate type" to "Count of ratings" And I set the field "Ratings > Type" to "Point" diff --git a/lib/form/tests/behat/modgrade_validation.feature b/lib/form/tests/behat/modgrade_validation.feature index 07dd527a289e1..96b3245b395f5 100644 --- a/lib/form/tests/behat/modgrade_validation.feature +++ b/lib/form/tests/behat/modgrade_validation.feature @@ -20,72 +20,54 @@ Feature: Using the activity grade form element | name | scale | | ABCDEF | F,E,D,C,B,A | | Letter scale | Disappointing, Good, Very good, Excellent | - And the following "activity" exists: - | activity | assign | - | course | C1 | - | section | 1 | - | name | Test assignment name | - | intro | Test assignment description | + And the following "activities" exist: + | activity | course | section | name | intro | idnumber | type | groupmode | + | assign | C1 | 1 | Test assignment name | Test assignment description | | | | + | forum | C1 | 1 | Test forum name | | forum1 | general | 0 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | student1 | Test forum name | Discussion subject | Discussion message | + @javascript Scenario: Being able to change the grade type, scale and maximum grade when there are no grades - Given I log in as "admin" - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Test forum name | Test forum description | C1 | forum1 | - And I am on the "Test forum name" "forum activity editing" page logged in as teacher1 + Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: - | Forum type | Standard forum for general use | - | Aggregate type | Average of ratings | - | scale[modgrade_type] | Point | - | scale[modgrade_point] | 100 | - | Group mode | No groups | + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | + | Ratings > scale[modgrade_point] | 60 | And I press "Save and return to course" And I am on the "Test forum name" "forum activity editing" page When I expand all fieldsets Then I should not see "Some grades have already been awarded, so the grade type" - And I set the field "scale[modgrade_type]" to "Scale" - And I set the field "scale[modgrade_scale]" to "ABCDEF" + And I set the field "id_scale_modgrade_type" to "Scale" + And I set the field "Ratings > scale[modgrade_scale]" to "ABCDEF" And I press "Save and display" And I should not see "You cannot change the type, as grades already exist for this item" And I navigate to "Settings" in current page administration And I expand all fieldsets And I should not see "Some grades have already been awarded, so the grade type" - And I set the field "scale[modgrade_scale]" to "Letter scale" + And I set the field "Ratings > scale[modgrade_scale]" to "Letter scale" And I press "Save and display" And I should not see "You cannot change the scale, as grades already exist for this item" And I navigate to "Settings" in current page administration And I expand all fieldsets And I should not see "Some grades have already been awarded, so the grade type" - And I set the field "scale[modgrade_type]" to "Point" - And I set the field "Maximum grade" to "50" + And I set the field "id_scale_modgrade_type" to "Point" + And I set the field "Ratings > Maximum grade" to "50" And I press "Save and display" And I should not see "You must choose whether to rescale existing grades or not" @javascript Scenario: Attempting to change the scale when grades already exist in rating activity - Given I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Forum type | Standard forum for general use | - | Description | Test forum description | - | Aggregate type | Average of ratings | - | scale[modgrade_type] | Scale | - | scale[modgrade_scale] | ABCDEF | - | Group mode | No groups | - And I log out - And I am on the "Test forum name" "forum activity" page logged in as student1 - And I click on "Add discussion topic" "link" + Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: - | Subject | Discussion subject | - | Message | Discussion message | - And I press "Post to forum" - And I log out - And I am on the "Test forum name" "forum activity" page logged in as teacher1 + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Scale | + | Ratings > scale[modgrade_scale] | ABCDEF | + And I press "Save and display" And I follow "Discussion subject" And I set the field "rating" to "D" - And I am on the "Test forum name" "forum activity" page - And I navigate to "Settings" in current page administration + And I am on the "Test forum name" "forum activity editing" page When I expand all fieldsets Then I should see "Some grades have already been awarded, so the grade type and scale cannot be changed" # Try saving the form and visiting it back to verify that everything is working ok. @@ -93,9 +75,9 @@ Feature: Using the activity grade form element And I should not see "When selecting a ratings aggregate type you must also select" And I navigate to "Settings" in current page administration And I expand all fieldsets - And the field "Aggregate type" matches value "Average of ratings" - And the field "scale[modgrade_type]" matches value "Scale" - And the field "scale[modgrade_scale]" matches value "ABCDEF" + And the field "Ratings > Aggregate type" matches value "Average of ratings" + And the field "id_scale_modgrade_type" matches value "Scale" + And the field "Ratings > scale[modgrade_scale]" matches value "ABCDEF" @javascript Scenario: Attempting to change the scale when grades already exist in non-rating activity @@ -122,30 +104,15 @@ Feature: Using the activity grade form element @javascript Scenario: Attempting to change the maximum grade when ratings exist - Given the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | forum | Test forum name | Test forum description | C1 | forum1 | 1 | - And I am on the "Test forum name" "forum activity editing" page logged in as teacher1 + Given I am on the "Test forum name" "forum activity editing" page logged in as teacher1 And I set the following fields to these values: - | Forum type | Standard forum for general use | - | Aggregate type | Average of ratings | - | scale[modgrade_type] | Point | - | scale[modgrade_point] | 100 | - | Group mode | No groups | - And I press "Save and return to course" - And I log out - And I am on the "Test forum name" "forum activity" page logged in as student1 - And I click on "Add discussion topic" "link" - And I set the following fields to these values: - | Subject | Discussion subject | - | Message | Discussion message | - And I press "Post to forum" - And I log out - And I am on the "Test forum name" "forum activity" page logged in as teacher1 + | Ratings > Aggregate type | Average of ratings | + | id_scale_modgrade_type | Point | + | Ratings > scale[modgrade_point] | 100 | + And I press "Save and display" And I follow "Discussion subject" And I set the field "rating" to "100" - And I am on the "Test forum name" "forum activity" page - And I navigate to "Settings" in current page administration + And I am on the "Test forum name" "forum activity editing" page When I expand all fieldsets Then I should see "You cannot change the type, as grades already exist for this item." And the "Maximum grade" "field" should be disabled diff --git a/mod/forum/report/summary/tests/behat/bulk_message.feature b/mod/forum/report/summary/tests/behat/bulk_message.feature index 0055ad5b01a59..4f0ed62ea24bc 100644 --- a/mod/forum/report/summary/tests/behat/bulk_message.feature +++ b/mod/forum/report/summary/tests/behat/bulk_message.feature @@ -19,8 +19,8 @@ Feature: Message users in the summary report | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | | teacher1 | forum1 | discussion1 | t1 earliest | diff --git a/mod/forum/report/summary/tests/behat/course_summary.feature b/mod/forum/report/summary/tests/behat/course_summary.feature index 3698483ef9e96..4357c493bcaed 100644 --- a/mod/forum/report/summary/tests/behat/course_summary.feature +++ b/mod/forum/report/summary/tests/behat/course_summary.feature @@ -24,11 +24,11 @@ Feature: Course level forum summary report | student2 | C2 | student | | student3 | C2 | student | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 forum 1 | C1 | forum1 | - | forum | forum2 | C1 forum 2 | C1 | forum2 | - | forum | forum3 | C1 forum 3 | C1 | forum3 | - | forum | forum4 | C2 forum 1 | C2 | forum4 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | + | forum | forum2 | C1 | forum2 | + | forum | forum3 | C1 | forum3 | + | forum | forum4 | C2 | forum4 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | created | | teacher1 | forum1 | discussion1 | Discussion 1 | ##2018-01-14 09:00:00## | @@ -100,9 +100,7 @@ Feature: Course level forum summary report Given the following "permission overrides" exist: | capability | permission | role | contextlevel | reference | | forumreport/summary:view | Allow | student | Course | C1 | - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "forum1" + When I am on the "forum1" "forum activity" page logged in as student1 And I navigate to "Reports" in current page administration And the following should exist in the "forumreport_summary_table" table: # | | Discussions | Replies | | | diff --git a/mod/forum/report/summary/tests/behat/double_enrolments_summary_data.feature b/mod/forum/report/summary/tests/behat/double_enrolments_summary_data.feature index 2bd204f375fd9..4532dcfef27c9 100644 --- a/mod/forum/report/summary/tests/behat/double_enrolments_summary_data.feature +++ b/mod/forum/report/summary/tests/behat/double_enrolments_summary_data.feature @@ -23,10 +23,10 @@ Feature: forum report shows post/reply/word counts correctly | student2 | C1 | student | self | | teacher1 | C2 | editingteacher | manual | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1 | - | forum | forum2 | C1 second forum | C1 | forum2 | - | forum | forum1 | C2 first forum | C2 | forum1 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | + | forum | forum2 | C1 | forum2 | + | forum | forum1 | C2 | forum1 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | attachments | inlineattachments | | teacher1 | forum1 | discussion1 | message1 | att1.jpg, att2.txt | | @@ -44,8 +44,7 @@ Feature: forum report shows post/reply/word counts correctly And the following forum discussions exist in course "Course 2": | user | forum | name | message | attachments | inlineattachments | | teacher1 | forum1 | discussion1 | message1 | att1.jpg, att2.txt | | - When I log in as "teacher1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as teacher1 And I follow "forum1" And I navigate to "Reports" in current page administration Then "Teacher 1" row "Number of attachments" column of "forumreport_summary_table" table should contain "6" diff --git a/mod/forum/report/summary/tests/behat/private_replies.feature b/mod/forum/report/summary/tests/behat/private_replies.feature index d59567a4129ca..8979ca4ee1352 100644 --- a/mod/forum/report/summary/tests/behat/private_replies.feature +++ b/mod/forum/report/summary/tests/behat/private_replies.feature @@ -21,8 +21,8 @@ Feature: Include private replies in the summary report | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | | teacher1 | forum1 | discussion1 | t1 earliest | @@ -33,12 +33,10 @@ Feature: Include private replies in the summary report | teacher1 | forum1 | discussion1 | t1 between | t1 between | | teacher1 | forum1 | discussion2 | t1 latest | t1 latest | | student1 | forum1 | discussion1 | s1 earliest | s1 earliest | - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I reply "s1 earliest" post from "discussion1" forum with: | Message | This is a private reply | | Reply privately | 1 | - And I log out Scenario: Private replies are counted for Teacher When I am on the forum1 "forum activity" page logged in as teacher2 diff --git a/mod/forum/report/summary/tests/behat/summary_data_access.feature b/mod/forum/report/summary/tests/behat/summary_data_access.feature index 259759d533eca..a2a256aba39f5 100644 --- a/mod/forum/report/summary/tests/behat/summary_data_access.feature +++ b/mod/forum/report/summary/tests/behat/summary_data_access.feature @@ -19,8 +19,8 @@ Feature: Report relevant content availability | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 forum | C1 | forum1 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | attachments | inlineattachments | | teacher1 | forum1 | discussion1 | message 1 | | | diff --git a/mod/forum/report/summary/tests/behat/summary_data_attachments.feature b/mod/forum/report/summary/tests/behat/summary_data_attachments.feature index 95fef9eb4b686..04087cec408c2 100644 --- a/mod/forum/report/summary/tests/behat/summary_data_attachments.feature +++ b/mod/forum/report/summary/tests/behat/summary_data_attachments.feature @@ -21,10 +21,10 @@ Feature: Attachments count column data available | student2 | C1 | student | | teacher1 | C2 | editingteacher | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1C1 | - | forum | forum2 | C1 second forum | C1 | forum2C1 | - | forum | forum1 | C2 first forum | C2 | forum1C2 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1C1 | + | forum | forum2 | C1 | forum2C1 | + | forum | forum1 | C2 | forum1C2 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | attachments | inlineattachments | | teacher1 | forum1 | discussion1 | message1 | att1.jpg, att2.txt | | diff --git a/mod/forum/report/summary/tests/behat/summary_data_post_dates.feature b/mod/forum/report/summary/tests/behat/summary_data_post_dates.feature index 1864c44e8a161..c70cd31ea45f9 100644 --- a/mod/forum/report/summary/tests/behat/summary_data_post_dates.feature +++ b/mod/forum/report/summary/tests/behat/summary_data_post_dates.feature @@ -21,10 +21,10 @@ Feature: Post date columns data available | student2 | C1 | student | | teacher1 | C2 | editingteacher | And the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1C1 | - | forum | forum2 | C1 second forum | C1 | forum2C1 | - | forum | forum1 | C2 first forum | C2 | forum1C2 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1C1 | + | forum | forum2 | C1 | forum2C1 | + | forum | forum1 | C2 | forum1C2 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | created | | teacher1 | forum1 | discussion1 | t1 earliest | ##2018-01-02 09:00:00## | diff --git a/mod/forum/report/summary/tests/behat/summary_filter_groups.feature b/mod/forum/report/summary/tests/behat/summary_filter_groups.feature index ba18bc26557ab..3c24a189f8b9c 100644 --- a/mod/forum/report/summary/tests/behat/summary_filter_groups.feature +++ b/mod/forum/report/summary/tests/behat/summary_filter_groups.feature @@ -34,10 +34,10 @@ Feature: Groups report filter is available if groups exist | teacher1 | G3 | | student1 | G3 | And the following "activities" exist: - | activity | name | description | course | idnumber | groupmode | - | forum | forum1 | C1 first forum | C1 | c1forum1 | 1 | - | forum | forum2 | C1 second forum | C1 | c1forum2 | 2 | - | forum | forum1 | C2 first forum | C2 | c2forum1 | 0 | + | activity | name | course | idnumber | groupmode | + | forum | forum1 | C1 | c1forum1 | 1 | + | forum | forum2 | C1 | c1forum2 | 2 | + | forum | forum1 | C2 | c2forum1 | 0 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | group | created | | teacher1 | forum1 | discussion1 | D1 message | G1 | ## 1 month ago ## | diff --git a/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature b/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature index d316fc6f5e5a5..87f4f237da78c 100644 --- a/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature +++ b/mod/forum/report/summary/tests/behat/summary_filter_no_groups.feature @@ -27,10 +27,10 @@ Feature: Groups report filter is not available if no groups exist | user | group | | teacher1 | G1 | And the following "activities" exist: - | activity | name | description | course | idnumber | groupmode | - | forum | forum1 | C1 first forum | C1 | forum1C1 | 0 | - | forum | forum2 | C1 second forum | C1 | forum2C1 | 0 | - | forum | forum1 | C2 first forum | C2 | forum1C2 | 2 | + | activity | name | course | idnumber | groupmode | + | forum | forum1 | C1 | forum1C1 | 0 | + | forum | forum2 | C1 | forum2C1 | 0 | + | forum | forum1 | C2 | forum1C2 | 2 | And the following forum discussions exist in course "Course 1": | user | forum | name | message | created | | teacher1 | forum1 | discussion1 | D1 message | ## 1 month ago ## | diff --git a/mod/forum/tests/behat/add_forum.feature b/mod/forum/tests/behat/add_forum.feature index d32f7bb8ba76c..187cbd1dc661e 100644 --- a/mod/forum/tests/behat/add_forum.feature +++ b/mod/forum/tests/behat/add_forum.feature @@ -17,22 +17,16 @@ Feature: Add forum activities and discussions | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Forum type | Standard forum for general use | - | Description | Test forum description | - And I add a new discussion to "Test forum name" forum with: - | Subject | Forum post 1 | - | Message | This is the body | - And I log out + And the following "activity" exists: + | activity | forum | + | course | C1 | + | name | Test forum name | + | type | general | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | attachments | + | teacher1 | Test forum name | Forum post 1 | this is the body | | + | student1 | Test forum name | Post with attachment | this is the body | empty.txt | And I log in as "student1" - And I am on "Course 1" course homepage - When I add a new discussion to "Test forum name" forum with: - | Subject | Post with attachment | - | Message | This is the body | - | Attachment | lib/tests/fixtures/empty.txt | And I reply "Forum post 1" post from "Test forum name" forum with: | Subject | Reply with attachment | | Message | This is the body | diff --git a/mod/forum/tests/behat/add_forum_inline.feature b/mod/forum/tests/behat/add_forum_inline.feature index 74eeaef6d53f9..0d157c7bfa978 100644 --- a/mod/forum/tests/behat/add_forum_inline.feature +++ b/mod/forum/tests/behat/add_forum_inline.feature @@ -13,20 +13,21 @@ Feature: Add forum activities and discussions utilizing the inline add discussio | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Forum type | Standard forum for general use | - | Description | Test forum description | - And I add a new discussion to "Test forum name" forum with: - | Subject | Forum post 1 | - | Message | This is the body | - And I log out + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 0001 | + | name | Test forum name | + | type | general | + And the following "mod_forum > discussion" exists: + | forum | 0001 | + | course | C1 | + | user | teacher1 | + | name | Forum post 1 | + | message | This is the body | Scenario: Student can add a discussion via the inline form - Given I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 Then I add a new discussion to "Test forum name" forum inline with: | Subject | Post with attachment | | Message | This is the body | diff --git a/mod/forum/tests/behat/discussion_lock.feature b/mod/forum/tests/behat/discussion_lock.feature index 1f06b51d1eb38..5adf1c9d8374e 100644 --- a/mod/forum/tests/behat/discussion_lock.feature +++ b/mod/forum/tests/behat/discussion_lock.feature @@ -15,22 +15,17 @@ Feature: As a teacher, you can manually lock individual discussions when viewing | course | C1 | | activity | forum | | name | Test forum name | - And I am on the "Course 1" course page logged in as admin - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 | - | Message | Discussion contents 1, first message | - And I reply "Discussion 1" post from "Test forum name" forum with: - | Subject | Reply 1 to discussion 1 | - | Message | Discussion contents 1, second message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 | - | Message | Discussion contents 2, first message | - And I reply "Discussion 2" post from "Test forum name" forum with: - | Subject | Reply 1 to discussion 2 | - | Message | Discussion contents 2, second message | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Discussion 1 | Discussion contents 1, first message | + | admin | Test forum name | Discussion 2 | Discussion contents 2, first message | + And the following forum replies exist in course "Course 1": + | user | forum | discussion | subject | message | + | admin | Test forum name | Discussion 1 | Reply 1 to discussion 1 | Discussion contents 1, second message | + | admin | Test forum name | Discussion 2 | Reply 1 to discussion 2 | Discussion contents 2, second message | Scenario: Lock a discussion and view - Given I am on the "Course 1" course page + Given I am on the "Course 1" course page logged in as admin And I navigate to post "Discussion 1" in "Test forum name" forum And I press "Settings" Then "Lock this discussion" "link" should be visible @@ -42,16 +37,14 @@ Feature: As a teacher, you can manually lock individual discussions when viewing And I press "Settings" And I follow "Discussion 2" Then I should not see "This discussion has been locked so you can no longer reply to it." - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I navigate to post "Discussion 1" in "Test forum name" forum Then I should see "This discussion has been locked so you can no longer reply to it." And "Reply" "link" should not be visible @accessibility Scenario: A locked discussion must be accessible - Given I am on the "Course 1" course page + Given I am on the "Course 1" course page logged in as admin And I navigate to post "Discussion 1" in "Test forum name" forum When I reply "Discussion 1" post from "Test forum name" forum with: | Subject | Discussion 1: Hello world! | @@ -62,7 +55,6 @@ Feature: As a teacher, you can manually lock individual discussions when viewing When I follow "Lock this discussion" # Check discussion view accessibility with info notification shown when discussion is locked. And the page should meet accessibility standards with "wcag143" extra tests - And I log out And I am on the "Test forum name" "forum activity" page logged in as student1 # Check discussion list accessibility with danger pill shown when discussion is locked. And the page should meet accessibility standards with "wcag143" extra tests diff --git a/mod/forum/tests/behat/discussion_navigation.feature b/mod/forum/tests/behat/discussion_navigation.feature index e635477225445..60759e8f11cb1 100644 --- a/mod/forum/tests/behat/discussion_navigation.feature +++ b/mod/forum/tests/behat/discussion_navigation.feature @@ -31,11 +31,9 @@ Feature: A user can navigate to previous and next discussions Scenario: A user can navigate between discussions Given the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum name | C1 | forum | 0 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + | activity | name | course | idnumber | groupmode | + | forum | Test forum name | C1 | forum | 0 | + And I am on the "Test forum name" "forum activity" page logged in as teacher1 And I add a new discussion to "Test forum name" forum with: | Subject | Discussion 1 | | Message | Test post message | @@ -72,37 +70,17 @@ Feature: A user can navigate to previous and next discussions Scenario: A user can navigate between discussions with visible groups Given the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum name | C1 | forum | 2 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test forum name" - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 0 | - | Message | Test post message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 0 | - | Message | Test post message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 1 | - | Message | Test post message | - | Group | Group 1 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 1 | - | Message | Test post message | - | Group | Group 1 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 2 | - | Message | Test post message | - | Group | Group 2 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 2 | - | Message | Test post message | - | Group | Group 2 | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + | activity | name | course | idnumber | groupmode | + | forum | Test forum name | C1 | forum | 2 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | group | + | teacher1 | Test forum name | Discussion 1 Group 0 | Test post message | | + | teacher1 | Test forum name | Discussion 2 Group 0 | Test post message | | + | teacher1 | Test forum name | Discussion 1 Group 1 | Test post message | G1 | + | teacher1 | Test forum name | Discussion 2 Group 1 | Test post message | G1 | + | teacher1 | Test forum name | Discussion 1 Group 2 | Test post message | G2 | + | teacher1 | Test forum name | Discussion 2 Group 2 | Test post message | G2 | + When I am on the "Test forum name" "forum activity" page logged in as student1 And I select "All participants" from the "Visible groups" singleselect And I follow "Discussion 1 Group 0" Then I should see "Discussion 2 Group 0" @@ -129,37 +107,17 @@ Feature: A user can navigate to previous and next discussions Scenario: A user can navigate between discussions with separate groups Given the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum name | C1 | forum | 1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test forum name" - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 0 | - | Message | Test post message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 0 | - | Message | Test post message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 1 | - | Message | Test post message | - | Group | Group 1 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 1 | - | Message | Test post message | - | Group | Group 1 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 Group 2 | - | Message | Test post message | - | Group | Group 2 | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 Group 2 | - | Message | Test post message | - | Group | Group 2 | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + | activity | name | course | idnumber | groupmode | + | forum | Test forum name | C1 | forum | 1 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | group | + | teacher1 | Test forum name | Discussion 1 Group 0 | Test post message | | + | teacher1 | Test forum name | Discussion 2 Group 0 | Test post message | | + | teacher1 | Test forum name | Discussion 1 Group 1 | Test post message | G1 | + | teacher1 | Test forum name | Discussion 2 Group 1 | Test post message | G1 | + | teacher1 | Test forum name | Discussion 1 Group 2 | Test post message | G2 | + | teacher1 | Test forum name | Discussion 2 Group 2 | Test post message | G2 | + When I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Discussion 1 Group 1" Then I should see "Discussion 2 Group 0" And I should see "Discussion 2 Group 1" diff --git a/mod/forum/tests/behat/discussion_post_threshold_warning.feature b/mod/forum/tests/behat/discussion_post_threshold_warning.feature index 704dc5fc73465..1a82c94a16e7f 100644 --- a/mod/forum/tests/behat/discussion_post_threshold_warning.feature +++ b/mod/forum/tests/behat/discussion_post_threshold_warning.feature @@ -43,7 +43,6 @@ Feature: An admin or teacher sets the post threshold for blocking and warning And I am on the "Test forum name" "forum activity" page And I click on "Test post subject two" "link" And I should not see "Reply" - And I log out # Verify that student2 is not affected by the posts made by student1 And I am on the "Test forum name" "forum activity" page logged in as student2 And I should see "Add discussion topic" diff --git a/mod/forum/tests/behat/discussion_subscriptions.feature b/mod/forum/tests/behat/discussion_subscriptions.feature index f00eac2ff2d8c..e708d8af71bcb 100644 --- a/mod/forum/tests/behat/discussion_subscriptions.feature +++ b/mod/forum/tests/behat/discussion_subscriptions.feature @@ -14,7 +14,6 @@ Feature: A user can control their own subscription preferences for a discussion And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | - And I log in as "admin" @javascript Scenario: An optional forum can have discussions subscribed to @@ -23,17 +22,12 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 0 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject two | - | Message | Test post message two | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + | admin | Test forum name | Test post subject two | Test post message two | When I am on the "Test forum name" "forum activity" page logged in as student1 Then I can subscribe to this forum And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row" @@ -68,17 +62,12 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject two | - | Message | Test post message two | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + | admin | Test forum name | Test post subject two | Test post message two | When I am on the "Test forum name" "forum activity" page logged in as student1 Then I can unsubscribe from this forum And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row" @@ -113,17 +102,12 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 0 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject two | - | Message | Test post message two | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + | admin | Test forum name | Test post subject two | Test post message two | And I am on the "Test forum name" "forum activity" page logged in as student1 And I can subscribe to this forum And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject one" "table_row" @@ -132,13 +116,10 @@ Feature: A user can control their own subscription preferences for a discussion And I can subscribe to this forum And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row" And "Subscribe to this discussion" "checkbox" should exist in the "Test post subject two" "table_row" - And I log out - And I am on the "Test forum name" "forum activity" page logged in as admin - And I navigate to "Settings" in current page administration + And I am on the "Test forum name" "forum activity editing" page logged in as admin And I set the following fields to these values: | Subscription mode | Auto subscription | And I press "Save and return to course" - And I log out And I am on the "Test forum name" "forum activity" page logged in as student1 And I can unsubscribe from this forum And "Unsubscribe from this discussion" "checkbox" should exist in the "Test post subject one" "table_row" @@ -155,17 +136,12 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 0 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject two | - | Message | Test post message two | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + | admin | Test forum name | Test post subject two | Test post message two | When I am on the "Test forum name" "forum activity" page logged in as student1 And I should see "Subscribe to forum" And I reply "Test post subject one" post from "Test forum name" forum with: @@ -193,16 +169,12 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject two | - | Message | Test post message two | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + | admin | Test forum name | Test post subject two | Test post message two | # added for this scenario And the following "users" exist: | username | firstname | lastname | email | @@ -210,7 +182,6 @@ Feature: A user can control their own subscription preferences for a discussion And the following "course enrolments" exist: | user | course | role | | student2 | C1 | student | - And I log out When I am on the "Test forum name" "forum activity" page logged in as student2 And I should see "Unsubscribe from forum" And I reply "Test post subject one" post from "Test forum name" forum with: @@ -234,16 +205,12 @@ Feature: A user can control their own subscription preferences for a discussion Scenario: A guest should not be able to subscribe to a discussion Given the following "activities" exist: - | activity | name | intro | course | section | idnumber | type | - | forum | Test forum name | Test forum description | Acceptance test site | 1 | forum1 | general | - And I am on site homepage - And I turn editing mode on - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I log out - When I log in as "guest" - And I follow "Test forum name" + | activity | name | course | section | idnumber | type | + | forum | Test forum name | Acceptance test site | 1 | forum1 | general | + And the following forum discussions exist in course "Acceptance test site": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + When I am on the "Test forum name" "forum activity" page logged in as guest Then "Subscribe to this discussion" "checkbox" should not exist in the "Test post subject one" "table_row" And "Unsubscribe from this discussion" "checkbox" should not exist in the "Test post subject one" "table_row" And I follow "Test post subject one" @@ -252,15 +219,13 @@ Feature: A user can control their own subscription preferences for a discussion Scenario: A user who is not logged in should not be able to subscribe to a discussion Given the following "activities" exist: - | activity | name | intro | course | section | idnumber | type | - | forum | Test forum name | Test forum description | Acceptance test site | 1 | forum1 | general | - And I am on site homepage - And I turn editing mode on - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I log out - When I follow "Test forum name" + | activity | name | course | section | idnumber | type | + | forum | Test forum name | Acceptance test site | 1 | forum1 | general | + And the following forum discussions exist in course "Acceptance test site": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | + When I am on site homepage + And I follow "Test forum name" Then "Subscribe to this discussion" "checkbox" should not exist in the "Test post subject one" "table_row" And "Unsubscribe from this discussion" "checkbox" should not exist in the "Test post subject one" "table_row" And I follow "Test post subject one" @@ -273,14 +238,11 @@ Feature: A user can control their own subscription preferences for a discussion | course | C1 | | idnumber | forum1 | | name | Test forum name | - | intro | Test forum description | | type | general | | forcesubscribe | 0 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject one | - | Message | Test post message one | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject one | Test post message one | When I am on the "Test forum name" "forum activity" page logged in as student1 Then "Subscribe to forum" "link" should exist And I follow "Test post subject one" diff --git a/mod/forum/tests/behat/edit_post_student.feature b/mod/forum/tests/behat/edit_post_student.feature index 42e66bc658f4d..d4c1bfbbee33a 100644 --- a/mod/forum/tests/behat/edit_post_student.feature +++ b/mod/forum/tests/behat/edit_post_student.feature @@ -15,10 +15,9 @@ Feature: Students can edit or delete their forum posts within a set time limit | user | course | role | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Test forum name | Test forum description | C1 | forum | - And I log in as "student1" - And I am on "Course 1" course homepage + | activity | name | course | idnumber | + | forum | Test forum name | C1 | forum | + And I am on the "Course 1" course page logged in as student1 And I add a new discussion to "Test forum name" forum with: | Subject | Forum post subject | | Message | This is the body | @@ -48,9 +47,7 @@ Feature: Students can edit or delete their forum posts within a set time limit | maxeditingtime | 1 | And I am on "Course 1" course homepage with editing mode on And I add the "Recent activity" block - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I should see "New forum posts:" in the "Recent activity" "block" And I should see "Forum post subject" in the "Recent activity" "block" When I wait "2" seconds diff --git a/mod/forum/tests/behat/edit_post_teacher.feature b/mod/forum/tests/behat/edit_post_teacher.feature index 6a9ec280d7ee5..eb820e508b822 100644 --- a/mod/forum/tests/behat/edit_post_teacher.feature +++ b/mod/forum/tests/behat/edit_post_teacher.feature @@ -17,25 +17,17 @@ Feature: Teachers can edit or delete any forum post | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | section | idnumber | - | forum | Test forum name | Test forum description | C1 | 1 | forum1 | - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Teacher post subject | - | Message | Teacher post message | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - And I reply "Teacher post subject" post from "Test forum name" forum with: - | Subject | Student post subject | - | Message | Student post message | + | activity | name | course | idnumber | + | forum | Test forum name | C1 | forum1 | + And the following "mod_forum > discussions" exist: + | forum | course | user | name | message | + | forum1 | C1 | teacher1 | Teacher post subject | Teacher post message | + And the following "mod_forum > posts" exist: + | user | parentsubject | subject | message | + | student1 | Teacher post subject | Student post subject | Student post message | Scenario: A teacher can delete another user's posts - Given I log out - And I log in as "teacher1" - When I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as teacher1 And I follow "Teacher post subject" And I click on "Delete" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element" And I press "Continue" @@ -43,10 +35,7 @@ Feature: Teachers can edit or delete any forum post And I should not see "Student post message" Scenario: A teacher can edit another user's posts - Given I log out - And I log in as "teacher1" - When I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as teacher1 And I follow "Teacher post subject" And I click on "Edit" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Student post subject')]" "xpath_element" And I set the following fields to these values: @@ -57,7 +46,7 @@ Feature: Teachers can edit or delete any forum post And I should see "Edited by Teacher 1 - original submission" Scenario: A student can't edit or delete another user's posts - When I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Teacher post subject" Then I should not see "Edit" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element" And I should not see "Delete" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Teacher post subject')]" "xpath_element" diff --git a/mod/forum/tests/behat/edit_tags.feature b/mod/forum/tests/behat/edit_tags.feature index 849e9bedd6ffa..94dc1b4d1288f 100644 --- a/mod/forum/tests/behat/edit_tags.feature +++ b/mod/forum/tests/behat/edit_tags.feature @@ -20,11 +20,9 @@ Feature: Edited forum posts handle tags correctly | course | C1 | | activity | forum | | name | Test forum name | - And I am on the "Course 1" Course page logged in as teacher1 - And I add a new discussion to "Test forum name" forum with: - | Subject | Teacher post subject | - | Message | Teacher post message | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | teacher1 | Test forum name | Teacher post subject | Teacher post message | @javascript Scenario: Forum post edition of custom tags works as expected @@ -46,7 +44,6 @@ Feature: Edited forum posts handle tags correctly And I follow "Add standard tags" And I set the field "Enter comma-separated list of new tags" to "OT1, OT2, OT3" And I press "Continue" - And I log out And I am on the "Test forum name" "forum activity" page logged in as teacher1 And I click on "Add discussion topic" "link" And I click on "Advanced" "button" diff --git a/mod/forum/tests/behat/favourite_discussion.feature b/mod/forum/tests/behat/favourite_discussion.feature index 8ff9650ef1579..eaf3822f404d2 100644 --- a/mod/forum/tests/behat/favourite_discussion.feature +++ b/mod/forum/tests/behat/favourite_discussion.feature @@ -15,14 +15,12 @@ Feature: A student can favourite a discussion via the forum settings menu | course | C1 | | activity | forum | | name | Test forum name | - And I am on the "Course 1" Course page logged in as admin - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 | - | Message | Discussion contents 1, first message | - And I reply "Discussion 1" post from "Test forum name" forum with: - | Subject | Reply 1 to discussion 1 | - | Message | Discussion contents 1, second message | - And I log out + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Discussion 1 | Discussion contents 1, first message | + And the following forum replies exist in course "Course 1": + | user | forum | discussion | name | message | + | admin | Test forum name | Discussion 1 | Reply 1 to discussion 1 | Discussion contents 1, second message | Scenario: Student can favourite a discussion from within an individual discussion Given I am on the "Course 1" Course page logged in as student1 diff --git a/mod/forum/tests/behat/forum_activity_breadcrumbs.feature b/mod/forum/tests/behat/forum_activity_breadcrumbs.feature index 4cb4892a2f630..ca01b8ce90878 100644 --- a/mod/forum/tests/behat/forum_activity_breadcrumbs.feature +++ b/mod/forum/tests/behat/forum_activity_breadcrumbs.feature @@ -14,7 +14,6 @@ Feature: A teacher or admin can view breadcrumbs in the reply, delete, split, ed And the following "activity" exists: | course | C1 | | activity | forum | - | intro | Test forum description | | name | Test forum name | Scenario: A teacher views add discussion topics advanced page @@ -26,8 +25,7 @@ Feature: A teacher or admin can view breadcrumbs in the reply, delete, split, ed And I should see "Test forum name" in the ".breadcrumb" "css_element" Scenario: A teacher adds posts and then verifies the breadcrumbs in the links - Given I log in as "teacher" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as teacher And I add a new discussion to "Test forum name" forum with: | Subject | Test post subject one | | Message | Test post message one | diff --git a/mod/forum/tests/behat/forum_activity_completion.feature b/mod/forum/tests/behat/forum_activity_completion.feature index 05044ba3f2815..fdadcf2653f1c 100644 --- a/mod/forum/tests/behat/forum_activity_completion.feature +++ b/mod/forum/tests/behat/forum_activity_completion.feature @@ -21,7 +21,6 @@ Feature: View activity completion in the forum activity | course | C1 | | idnumber | mh1 | | name | Music history | - | section | 1 | And I am on the "Music history" "forum activity editing" page logged in as teacher1 And I expand all fieldsets And I set the following fields to these values: @@ -36,7 +35,6 @@ Feature: View activity completion in the forum activity | completionrepliesenabled | 1 | | completionreplies | 1 | And I press "Save and display" - And I log out Scenario: View automatic completion items as a teacher When I am on the "Music history" "forum activity" page logged in as teacher1 @@ -72,14 +70,12 @@ Feature: View activity completion in the forum activity And the "Make forum posts: 2" completion condition of "Music history" is displayed as "done" And the "Post replies: 1" completion condition of "Music history" is displayed as "done" And the "Receive a grade" completion condition of "Music history" is displayed as "todo" - And I log out # Grade the student And I am on the "Music history" "forum activity" page logged in as teacher1 And I press "Grade users" And I set the field "grade" to "33" And I press "Save" And I press "Close grader" - And I log out # All conditions should now be completed. When I am on the "Music history" "forum activity" page logged in as student1 Then the "View" completion condition of "Music history" is displayed as "done" @@ -90,14 +86,12 @@ Feature: View activity completion in the forum activity @javascript Scenario: Use manual completion - Given I am on the "Music history" "forum activity" page logged in as teacher1 - And I navigate to "Settings" in current page administration + Given I am on the "Music history" "forum activity editing" page logged in as teacher1 And I expand all fieldsets And I set the field "Completion tracking" to "Students can manually mark the activity as completed" And I press "Save and display" # Teacher view. And the manual completion button for "Music history" should be disabled - And I log out # Student view. When I am on the "Music history" "forum activity" page logged in as student1 Then the manual completion button of "Music history" is displayed as "Mark as done" diff --git a/mod/forum/tests/behat/forum_activity_completion_pass_grade.feature b/mod/forum/tests/behat/forum_activity_completion_pass_grade.feature index db71d7b5beb18..9d1034f532d77 100644 --- a/mod/forum/tests/behat/forum_activity_completion_pass_grade.feature +++ b/mod/forum/tests/behat/forum_activity_completion_pass_grade.feature @@ -16,8 +16,7 @@ Feature: Completion pass grade view activity completion in the forum activity | user | course | role | | student1 | C1 | student | | teacher1 | C1 | editingteacher | - And I log in as "teacher1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Settings" in current page administration And I expand all fieldsets And I set the following fields to these values: @@ -29,9 +28,7 @@ Feature: Completion pass grade view activity completion in the forum activity | course | C1 | | idnumber | mh1 | | name | Music history | - | section | 1 | - And I am on the "Music history" "forum activity" page - And I navigate to "Settings" in current page administration + And I am on the "Music history" "forum activity editing" page And I expand all fieldsets And I set the following fields to these values: | Whole forum grading > Type | Point | @@ -47,7 +44,6 @@ Feature: Completion pass grade view activity completion in the forum activity | completionrepliesenabled | 1 | | completionreplies | 1 | And I press "Save and display" - And I log out Scenario: View automatic completion items as a teacher Given I am on the "Music history" "forum activity" page logged in as teacher1 @@ -87,14 +83,12 @@ Feature: Completion pass grade view activity completion in the forum activity And the "Post replies: 1" completion condition of "Music history" is displayed as "done" And the "Receive a grade" completion condition of "Music history" is displayed as "todo" And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo" - And I log out # Grade the student And I am on the "Music history" "forum activity" page logged in as teacher1 And I press "Grade users" And I set the field "grade" to "33" And I press "Save" And I press "Close grader" - And I log out # All conditions should now be completed. When I am on the "Music history" "forum activity" page logged in as student1 Then the "View" completion condition of "Music history" is displayed as "done" @@ -133,14 +127,12 @@ Feature: Completion pass grade view activity completion in the forum activity And the "Post replies: 1" completion condition of "Music history" is displayed as "done" And the "Receive a grade" completion condition of "Music history" is displayed as "todo" And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo" - And I log out # Grade the student And I am on the "Music history" "forum activity" page logged in as teacher1 And I press "Grade users" And I set the field "grade" to "60" And I press "Save" And I press "Close grader" - And I log out # All conditions should now be completed. When I am on the "Music history" "forum activity" page logged in as student1 Then the "View" completion condition of "Music history" is displayed as "done" diff --git a/mod/forum/tests/behat/forum_export.feature b/mod/forum/tests/behat/forum_export.feature index 12d71f84e6c57..2b98f81f16e28 100644 --- a/mod/forum/tests/behat/forum_export.feature +++ b/mod/forum/tests/behat/forum_export.feature @@ -18,8 +18,8 @@ Feature: Export forum | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | type | course | idnumber | - | forum | Test forum 1 | Test forum 1 description | general | C1 | 123 | + | activity | name | type | course | idnumber | + | forum | Test forum 1 | general | C1 | 123 | Scenario: Teacher can export forum Given I am on the "Test forum 1" "forum activity" page logged in as teacher1 @@ -30,12 +30,10 @@ Feature: Export forum And I should not see "Student 2" in the ".form-autocomplete-suggestions" "css_element" # This will fail if an exception is thrown. This is the best we can do without the ability to use the download. Hence, there is no "Then" step. And I click on "Export" "button" - And I log out Scenario: Students cannot export forum by default Given I am on the "Test forum 1" "forum activity" page logged in as student1 Then "Export" "link" should not exist in current page administration - And I log out Scenario: User with the capability can export Given the following "permission overrides" exist: diff --git a/mod/forum/tests/behat/forum_subscribers_navigation.feature b/mod/forum/tests/behat/forum_subscribers_navigation.feature index 03fc82362bad5..82c98ef542e0f 100644 --- a/mod/forum/tests/behat/forum_subscribers_navigation.feature +++ b/mod/forum/tests/behat/forum_subscribers_navigation.feature @@ -14,7 +14,6 @@ Feature: A teacher or admin can view subscriptions tab And the following "activity" exists: | course | C1 | | activity | forum | - | intro | Test forum description | | name | Test forum name | Scenario: A teacher views view subscribers by default and views the Subscribers heading diff --git a/mod/forum/tests/behat/forum_subscription_landing_page.feature b/mod/forum/tests/behat/forum_subscription_landing_page.feature index b2574ca13be9b..0d1d1eef98a25 100644 --- a/mod/forum/tests/behat/forum_subscription_landing_page.feature +++ b/mod/forum/tests/behat/forum_subscription_landing_page.feature @@ -14,7 +14,6 @@ Feature: A teacher or admin when changes the subscription mode should land in th And the following "activity" exists: | course | C1 | | activity | forum | - | intro | Test forum description | | name | Test forum name | Scenario: A teacher views subscriptions tab and changes the subscriptions mode to forced mode and lands in subscription tab diff --git a/mod/forum/tests/behat/forum_subscriptions.feature b/mod/forum/tests/behat/forum_subscriptions.feature index 9b81d6b841e3d..d6d1d84727d29 100644 --- a/mod/forum/tests/behat/forum_subscriptions.feature +++ b/mod/forum/tests/behat/forum_subscriptions.feature @@ -14,84 +14,42 @@ Feature: A user can control their own subscription preferences for a forum And the following "course enrolments" exist: | user | course | role | | student1 | C1 | student | + And the following "activities" exist: + | activity | course | idnumber | name | type | + | forum | C1 | forum1 | Test forum name | general | + And the following "mod_forum > discussions" exist: + | forum | course | user | name | message | + | forum1 | C1 | admin | Test post subject | Test post message | And I log in as "admin" Scenario: A disallowed subscription forum cannot be subscribed to - Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | forum1 | - | name | Test forum name | - | intro | Test forum description | - | type | general | - | section | 1 | - And I am on "Course 1" course homepage - Given I follow "Test forum name" - And I navigate to "Settings" in current page administration + Given I am on the "Test forum name" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Subscription disabled | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should not see "Subscribe to this forum" And I should not see "Unsubscribe from this forum" And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject" "table_row" And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject" "table_row" Scenario: A forced subscription forum cannot be subscribed to - Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | forum1 | - | name | Test forum name | - | intro | Test forum description | - | type | general | - | section | 1 | - And I am on "Course 1" course homepage - Given I follow "Test forum name" - And I navigate to "Settings" in current page administration + Given I am on the "Test forum name" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Forced subscription | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should not see "Subscribe to this forum" And I should not see "Unsubscribe from this forum" And "You are subscribed to this discussion. Click to unsubscribe." "link" should not exist in the "Test post subject" "table_row" And "You are not subscribed to this discussion. Click to subscribe." "link" should not exist in the "Test post subject" "table_row" Scenario: An optional forum can be subscribed to - Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | forum1 | - | name | Test forum name | - | intro | Test forum description | - | type | general | - | section | 1 | - And I am on "Course 1" course homepage - Given I follow "Test forum name" - And I navigate to "Settings" in current page administration + Given I am on the "Test forum name" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Optional subscription | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should see "Subscribe to forum" And I should not see "Unsubscribe from forum" And I follow "Subscribe to forum" @@ -100,27 +58,11 @@ Feature: A user can control their own subscription preferences for a forum And I should not see "Subscribe to forum" Scenario: An Automatic forum can be unsubscribed from - Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | forum1 | - | name | Test forum name | - | intro | Test forum description | - | type | general | - | section | 1 | - And I am on "Course 1" course homepage - Given I follow "Test forum name" - And I navigate to "Settings" in current page administration + Given I am on the "Test forum name" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Auto subscription | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should see "Unsubscribe from forum" And I should not see "Subscribe to forum" And I follow "Unsubscribe from forum" diff --git a/mod/forum/tests/behat/forum_subscriptions_availability.feature b/mod/forum/tests/behat/forum_subscriptions_availability.feature index 560528f3c671a..71fb3cb9647f4 100644 --- a/mod/forum/tests/behat/forum_subscriptions_availability.feature +++ b/mod/forum/tests/behat/forum_subscriptions_availability.feature @@ -34,17 +34,17 @@ Feature: As a teacher I need to see an accurate list of subscribed users And the following "grouping groups" exist: | grouping | group | | GG1 | G1 | + And the following "activities" exist: + | activity | course | idnumber | type | name | forcesubscribe | + | forum | C1 | 1 | general | Forced Forum 1 | 1 | + | forum | C1 | 0001 | general | Forced Forum 2 | | + | forum | C1 | 0002 | general | Forced Forum 3 | 2 | And I log in as "teacher" And I am on "Course 1" course homepage with editing mode on @javascript Scenario: A forced forum lists all subscribers - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forced Forum 1 | - | Forum type | Standard forum for general use | - | Description | Test forum description | - | Subscription mode | Forced subscription | - And I am on the "Forced Forum 1" "forum activity" page + When I am on the "Forced Forum 1" "forum activity" page And I navigate to "Subscriptions" in current page administration Then I should see "Student 1" And I should see "Teacher Teacher" @@ -63,16 +63,7 @@ Feature: As a teacher I need to see an accurate list of subscribed users And I should not see "Student 3" Scenario: A forced forum does not allow to edit the subscribers - Given the following "activity" exists: - | activity | forum | - | name | Forced Forum 2 | - | intro | Test forum description | - | type | general | - | course | C1 | - | idnumber | 0001 | - | section | 1 | - And I am on the "Forced Forum 2" "forum activity" page - And I navigate to "Settings" in current page administration + Given I am on the "Forced Forum 2" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Forced subscription | | Availability | Show on course page | @@ -85,16 +76,7 @@ Feature: As a teacher I need to see an accurate list of subscribed users And I should see "Student 3" Scenario: A forced and hidden forum lists only teachers - Given the following "activity" exists: - | activity | forum | - | name | Forced Forum 2 | - | intro | Test forum description | - | type | general | - | course | C1 | - | idnumber | 0001 | - | section | 1 | - And I am on "Course 1" course homepage - And I am on the "Forced Forum 2" "forum activity editing" page + Given I am on the "Forced Forum 2" "forum activity editing" page And I set the following fields to these values: | Subscription mode | Forced subscription | | Availability | Hide on course page | @@ -108,19 +90,13 @@ Feature: As a teacher I need to see an accurate list of subscribed users @javascript Scenario: An automatic forum lists all subscribers - When I add a "Forum" to section "1" and I fill the form with: - | Forum name | Forced Forum 1 | - | Forum type | Standard forum for general use | - | Description | Test forum description | - | Subscription mode | Auto subscription | - And I am on the "Forced Forum 1" "forum activity" page + When I am on the "Forced Forum 3" "forum activity" page And I navigate to "Subscriptions" in current page administration Then I should see "Student 1" And I should see "Teacher Teacher" And I should see "Student 2" And I should see "Student 3" - And I am on "Course 1" course homepage - And I am on the "Forced Forum 1" "forum activity editing" page + And I am on the "Forced Forum 3" "forum activity editing" page And I expand all fieldsets And I click on "Add restriction..." "button" And I click on "Grouping" "button" in the "Add restriction..." "dialogue" diff --git a/mod/forum/tests/behat/forum_subscriptions_default.feature b/mod/forum/tests/behat/forum_subscriptions_default.feature index 76a84a0bda9a0..965ed07e05bf2 100644 --- a/mod/forum/tests/behat/forum_subscriptions_default.feature +++ b/mod/forum/tests/behat/forum_subscriptions_default.feature @@ -17,36 +17,31 @@ Feature: A user can control their default discussion subscription settings | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | type | section | - | forum | Test forum name | Test forum description | C1 | forump1 | general | 1 | + | activity | name | course | idnumber | type | + | forum | Test forum name | C1 | forump1 | general | And I am on the "Test forum name" "forum activity editing" page logged in as admin And I set the following fields to these values: | Subscription mode | Optional subscription | And I press "Save and return to course" - And I log out Scenario: Creating a new discussion in an optional forum follows user preferences Given I am on the "Test forum name" "forum activity" page logged in as student1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist - And I log out And I am on the "Test forum name" "forum activity" page logged in as student2 And I click on "Add discussion topic" "link" And I click on "Advanced" "button" And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist Scenario: Replying to an existing discussion in an optional forum follows user preferences - Given I am on the "Test forum name" "forum activity" page logged in as admin - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out + Given the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject | Test post message | And I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Test post subject" When I follow "Reply" Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist - And I log out And I am on the "Test forum name" "forum activity" page logged in as student2 And I follow "Test post subject" And I follow "Reply" @@ -57,31 +52,27 @@ Feature: A user can control their default discussion subscription settings And I set the following fields to these values: | Subscription mode | Auto subscription | And I press "Save and return to course" - And I log out And I am on the "Test forum name" "forum activity" page logged in as student1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist - And I log out And I am on the "Test forum name" "forum activity" page logged in as student2 And I click on "Add discussion topic" "link" And I click on "Advanced" "button" And "input[name=discussionsubscribe][checked=checked]" "css_element" should exist Scenario: Replying to an existing discussion in an automatic forum follows forum subscription - Given I am on the "Test forum name" "forum activity editing" page logged in as admin + Given the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject | Test post message | + And I am on the "Test forum name" "forum activity editing" page logged in as admin And I set the following fields to these values: | Subscription mode | Optional subscription | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out And I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Test post subject" When I follow "Reply" Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist - And I log out And I am on the "Test forum name" "forum activity" page logged in as student2 And I follow "Test post subject" And I follow "Reply" @@ -89,21 +80,19 @@ Feature: A user can control their default discussion subscription settings @javascript Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences - Given I am on the "Test forum name" "forum activity editing" page logged in as admin + Given the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | admin | Test forum name | Test post subject | Test post message | + And I am on the "Test forum name" "forum activity editing" page logged in as admin And I set the following fields to these values: | Subscription mode | Auto subscription | And I press "Save and return to course" - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out And I am on the "Test forum name" "forum activity" page logged in as student1 And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row" And I follow "Test post subject" When I follow "Reply" And I click on "Advanced" "button" And "input[name=discussionsubscribe][checked]" "css_element" should exist - And I log out And I am on the "Test forum name" "forum activity" page logged in as student2 And I click on "input[id^=subscription-toggle]" "css_element" in the "Test post subject" "table_row" And I follow "Test post subject" diff --git a/mod/forum/tests/behat/forum_subscriptions_management.feature b/mod/forum/tests/behat/forum_subscriptions_management.feature index 83c819910e4f2..377c8b7844792 100644 --- a/mod/forum/tests/behat/forum_subscriptions_management.feature +++ b/mod/forum/tests/behat/forum_subscriptions_management.feature @@ -24,11 +24,8 @@ Feature: A teacher can control the subscription to a forum | activity | forum | | course | C1 | | idnumber | f01 | - | intro | Test forum description | | name | Test forum name | - When I log in as "teacher" - And I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as teacher And I navigate to "Subscriptions" in current page administration Then I select "Manage subscribers" from the "Subscribers" singleselect And "Add" "button" should exist diff --git a/mod/forum/tests/behat/forum_subscriptions_mode_behaviour.feature b/mod/forum/tests/behat/forum_subscriptions_mode_behaviour.feature index 22243710750cf..758cdd176450a 100644 --- a/mod/forum/tests/behat/forum_subscriptions_mode_behaviour.feature +++ b/mod/forum/tests/behat/forum_subscriptions_mode_behaviour.feature @@ -19,15 +19,12 @@ Feature: Changes to the subscription mode of a forum can change subcribers of a | activity | forum | | idnumber | f01 | | course | C1 | - | intro | Test forum description | | name | Test forum name | | type | general | | forcesubscribe | 1 | - And I log in as "teacher" - And I am on "Course 1" course homepage Scenario: A change from Forced subscription to Auto subcription causes all participants to be subscribed - Given I follow "Test forum name" + Given I am on the "Test forum name" "forum activity" page logged in as teacher And I navigate to "Subscriptions" in current page administration When I select "Auto subscription" from the "Subscription mode" singleselect Then I should not see "There are no subscribers yet for this forum" diff --git a/mod/forum/tests/behat/grade_forum.feature b/mod/forum/tests/behat/grade_forum.feature index 43e1ef4989650..b806acf928ad5 100644 --- a/mod/forum/tests/behat/grade_forum.feature +++ b/mod/forum/tests/behat/grade_forum.feature @@ -23,17 +23,18 @@ Feature: I can grade a students interaction across a forum And the following "scales" exist: | name | scale | | Test Scale 1 | Disappointing, Good, Very good, Excellent | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 0001 | + | name | Test Forum 1 | And I log in as "teacher1" And I change window size to "large" - And I am on "Course 1" course homepage - And I turn editing mode on + And I am on "Course 1" course homepage with editing mode on Scenario: Ensure that forum grade settings do not leak to Ratings - Given I add a "Forum" to section "1" + Given I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets - And I set the following fields to these values: - | Forum name | Test Forum 1 | - | Description | Test | # Fields should be hidden when grading is not set. When I set the field "Whole forum grading > Type" to "None" @@ -59,7 +60,6 @@ Feature: I can grade a students interaction across a forum And I set the field "Whole forum grading > Grade to pass" to "4" When I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook - And I turn editing mode on # There shouldn't be any Ratings grade item. Then I should see "Test Forum 1 whole forum" @@ -74,11 +74,8 @@ Feature: I can grade a students interaction across a forum And I should see "Tutor" in the "Parent category" "fieldset" Scenario: Ensure that Ratings settings do not leak to Forum grading - Given I add a "Forum" to section "1" + Given I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets - And I set the following fields to these values: - | Forum name | Test Forum 1 | - | Description | Test | # Fields should be hidden when grading is not set. When I set the field "Ratings > Aggregate type" to "No ratings" @@ -130,17 +127,9 @@ Feature: I can grade a students interaction across a forum And I should see "Tutor" in the "Parent category" "fieldset" Scenario: Setting both a rating and a whole forum grade does not bleed - Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | 0001 | - | name | Test Forum 1 | - | intro | Test | - | section | 1 | - And I am on "Course 1" course homepage - And I follow "Test Forum 1" - And I navigate to "Settings" in current page administration + Given I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets + And I set the field "Ratings > Aggregate type" to "Count of ratings" And I set the field "Ratings > Type" to "Point" And I set the field "Ratings > Maximum grade" to "100" @@ -152,7 +141,6 @@ Feature: I can grade a students interaction across a forum And I set the field "Whole forum grading > Grade to pass" to "4" And I press "Save and return to course" And I navigate to "View > Grader report" in the course gradebook - And I turn editing mode on # There shouldn't be any Whole forum grade gradeitem. Then I should see "Test Forum 1 rating" diff --git a/mod/forum/tests/behat/grade_view_discussion.feature b/mod/forum/tests/behat/grade_view_discussion.feature index e992a6c5ba9a8..eaf1a18f018d6 100644 --- a/mod/forum/tests/behat/grade_view_discussion.feature +++ b/mod/forum/tests/behat/grade_view_discussion.feature @@ -22,7 +22,6 @@ Feature: View discussion while grading in a forum And the following "activity" exists: | activity | forum | | name | Gradable forum | - | intro | Standard forum description | | course | C1 | | idnumber | forum1 | | grade_forum | 100 | diff --git a/mod/forum/tests/behat/groups_in_course_no_groups_in_forum.feature b/mod/forum/tests/behat/groups_in_course_no_groups_in_forum.feature index beca11cbbd3d7..899130cbc6bf7 100644 --- a/mod/forum/tests/behat/groups_in_course_no_groups_in_forum.feature +++ b/mod/forum/tests/behat/groups_in_course_no_groups_in_forum.feature @@ -26,13 +26,11 @@ Feature: Forums in 'No groups' mode allow posting to All participants for all us | teacher1 | G2 | | student1 | G1 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Standard forum name | Standard forum description | C1 | nogroups | 0 | + | activity | name | course | idnumber | groupmode | + | forum | Standard forum name | C1 | nogroups | 0 | Scenario: Teacher can post - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 And I should not see "Group A" And I should not see "Group B" When I click on "Add discussion topic" "link" @@ -46,9 +44,7 @@ Feature: Forums in 'No groups' mode allow posting to All participants for all us And I should see "Teacher 1 -> Forum" Scenario: Student can post - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as student1 And I should not see "Group A" And I should not see "Group B" When I click on "Add discussion topic" "link" diff --git a/mod/forum/tests/behat/h5p_inline_editing_content.feature b/mod/forum/tests/behat/h5p_inline_editing_content.feature index 28bffa4ea205f..92868c0448170 100644 --- a/mod/forum/tests/behat/h5p_inline_editing_content.feature +++ b/mod/forum/tests/behat/h5p_inline_editing_content.feature @@ -22,8 +22,8 @@ Feature: Inline editing H5P content in mod_forum | contextlevel | reference | contenttype | user | contentname | filepath | | Course | C1 | contenttype_h5p | admin | Greeting card | /h5p/tests/fixtures/greeting-card.h5p | And the following "activities" exist: - | activity | name | intro | introformat | course | content | contentformat | idnumber | - | forum | ForumName1 | PageDesc1 | 1 | C1 | H5Ptest | 1 | 1 | + | activity | name | introformat | course | content | contentformat | idnumber | + | forum | ForumName1 | 1 | C1 | H5Ptest | 1 | 1 | And the "displayh5p" filter is "on" # Override this capability to let teachers and students to Turn editing on. And the following "permission overrides" exist: @@ -33,10 +33,8 @@ Feature: Inline editing H5P content in mod_forum @javascript @repository_contentbank Scenario: Edit H5P content from a forum intro using copy to content bank file - Given I am on the "C1" "Course" page logged in as "admin" + Given I am on the "ForumName1" "forum activity editing" page logged in as admin # Add H5P content to the forum description. - And I am on the "ForumName1" "forum activity" page - And I navigate to "Settings" in current page administration And I click on "Insert H5P" "button" in the "#fitem_id_introeditor" "css_element" And I click on "Browse repositories..." "button" in the "Insert H5P" "dialogue" And I select "Content bank" repository in file picker @@ -63,23 +61,20 @@ Feature: Inline editing H5P content in mod_forum And I log out # Check teacher2 (non-editing teacher) can't see the Edit button, because she can't edit the forum activity. And I log in as "teacher2" - And I turn editing mode on - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on And I am on the "ForumName1" "forum activity" page And I should not see "Edit H5P content" And I log out # Check student1 can't see the Edit button. And I log in as "student1" - And I turn editing mode on - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on And I am on the "ForumName1" "forum activity" page And I should not see "Edit H5P content" @javascript @repository_contentbank Scenario: Edit H5P content from a forum post - Given I am on the "C1" "Course" page logged in as "admin" + Given I am on the "ForumName1" "forum activity" page logged in as admin # Add H5P content to a forum post as admin. - And I am on the "ForumName1" "forum activity" page And I click on "Add discussion topic" "link" And I set the following fields to these values: | Subject | Forum post by admin | @@ -111,16 +106,14 @@ Feature: Inline editing H5P content in mod_forum And I log out # Check teacher2 (non-editing teacher) can see the Edit button because she can edit the post too. And I log in as "teacher2" - And I turn editing mode on - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on And I am on the "ForumName1" "forum activity" page And I follow "Forum post by admin" And I should see "Edit H5P content" And I log out # Check student1 can't see the Edit button. And I log in as "student1" - And I turn editing mode on - And I am on "Course 1" course homepage + And I am on "Course 1" course homepage with editing mode on And I am on the "ForumName1" "forum activity" page And I follow "Forum post by admin" And I should not see "Edit H5P content" diff --git a/mod/forum/tests/behat/inpage_reply.feature b/mod/forum/tests/behat/inpage_reply.feature index 73ded21645180..c6e78956fd69e 100644 --- a/mod/forum/tests/behat/inpage_reply.feature +++ b/mod/forum/tests/behat/inpage_reply.feature @@ -13,35 +13,30 @@ Feature: Students can reply to a discussion in page. | user | course | role | | student1 | C1 | student | | teacher1 | C1 | editingteacher | - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Forum" to section "1" and I fill the form with: - | Forum name | Test forum name | - | Description | Test forum description | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 1 | - | Message | Discussion contents 1, first message | - And I add a new discussion to "Test forum name" forum with: - | Subject | Discussion 2 | - | Message | Discussion contents 2, first message | - And I log out + And the following "activity" exists: + | activity | forum | + | course | C1 | + | idnumber | 0001 | + | name | Test forum name | + And the following "mod_forum > discussions" exist: + | forum | course | user | name | message | + | 0001 | C1 | teacher1 | Discussion 1 | Discussion contents 1, first message | + | 0001 | C1 | teacher1 | Discussion 2 | Discussion contents 2, first message | Scenario: Confirm inpage replies work - Given I log in as "student1" - And I am on "Course 1" course homepage - Given I reply "Discussion 2" post from "Test forum name" forum using an inpage reply with: + Given I am on the "Course 1" course page logged in as student1 + When I reply "Discussion 2" post from "Test forum name" forum using an inpage reply with: | post | Discussion contents 1, third message | Then I should see "Discussion contents 1, third message" - When I reload the page - Then I should see "Discussion contents 1, third message" + And I reload the page + And I should see "Discussion contents 1, third message" Scenario: Confirm inpage replies work - private reply - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I reply "Discussion 2" post from "Test forum name" forum using an inpage reply with: + Given I am on the "Course 1" course page logged in as teacher1 + When I reply "Discussion 2" post from "Test forum name" forum using an inpage reply with: | post | Discussion contents 1, third message | | privatereply | 1 | Then I should see "Discussion contents 1, third message" - Then I should see "This is a private reply. (Teachers and other users with the capability to view private replies can also see it.)" - When I reload the page - Then I should see "Discussion contents 1, third message" + And I should see "This is a private reply. (Teachers and other users with the capability to view private replies can also see it.)" + And I reload the page + And I should see "Discussion contents 1, third message" diff --git a/mod/forum/tests/behat/move_discussion.feature b/mod/forum/tests/behat/move_discussion.feature index 9590e650863b4..9a823319d8aa4 100644 --- a/mod/forum/tests/behat/move_discussion.feature +++ b/mod/forum/tests/behat/move_discussion.feature @@ -19,19 +19,13 @@ Feature: A teacher can move discussions between forums Scenario: A teacher can move discussions Given the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum 1 | Test forum 2 | C1 | forum | 0 | - | forum | Test forum 2 | Test forum 1 | C1 | forum | 0 | - And I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum 1" - And I add a new discussion to "Test forum 1" forum with: - | Subject | Discussion 1 | - | Message | Test post message | - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test forum 1" + | activity | name | course | idnumber | groupmode | + | forum | Test forum 1 | C1 | forum | 0 | + | forum | Test forum 2 | C1 | forum | 0 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | student1 | Test forum 1 | Discussion 1 | Test post message | + And I am on the "Test forum 1" "forum activity" page logged in as teacher1 And I follow "Discussion 1" When I set the field "jump" to "Test forum 2" And I press "Move" diff --git a/mod/forum/tests/behat/my_forum_posts.feature b/mod/forum/tests/behat/my_forum_posts.feature index 1805ff740d8b3..35a1d0afe7f9c 100644 --- a/mod/forum/tests/behat/my_forum_posts.feature +++ b/mod/forum/tests/behat/my_forum_posts.feature @@ -15,15 +15,15 @@ Feature: A user can view their posts and discussions | user | course | role | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum name | Test forum | C1 | forum | 0 | + | activity | name | course | idnumber | groupmode | + | forum | Test forum name | C1 | forum | 0 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | student1 | Test forum name | Forum discussion 1 | How awesome is this forum discussion? | + And the following forum replies exist in course "Course 1": + | user | forum | discussion | message | + | student1 | Test forum name | Forum discussion 1 | Actually, I've seen better. | And I log in as "student1" - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Forum discussion 1 | - | Message | How awesome is this forum discussion? | - And I reply "Forum discussion 1" post from "Test forum name" forum with: - | Message | Actually, I've seen better. | When I follow "Profile" in the user menu And I follow "Forum posts" Then I should see "How awesome is this forum discussion?" diff --git a/mod/forum/tests/behat/no_groups_in_course.feature b/mod/forum/tests/behat/no_groups_in_course.feature index 887dddc35c054..a3dda40559041 100644 --- a/mod/forum/tests/behat/no_groups_in_course.feature +++ b/mod/forum/tests/behat/no_groups_in_course.feature @@ -14,15 +14,13 @@ Feature: Posting to forums in a course with no groups behaves correctly | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Standard forum | Standard forum description | C1 | nogroups | 0 | - | forum | Visible forum | Visible forum description | C1 | visgroups | 2 | - | forum | Separate forum | Separate forum description | C1 | sepgroups | 1 | + | activity | name | course | idnumber | groupmode | + | forum | Standard forum | C1 | nogroups | 0 | + | forum | Visible forum | C1 | visgroups | 2 | + | forum | Separate forum | C1 | sepgroups | 1 | Scenario: Teachers can post in standard forum - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum" + Given I am on the "Standard forum" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" Then I should not see "Post a copy to all groups" And I set the following fields to these values: @@ -33,9 +31,7 @@ Feature: Posting to forums in a course with no groups behaves correctly And I should see "Teacher -> All participants" Scenario: Teachers can post in forum with separate groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Separate forum" + Given I am on the "Separate forum" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" Then I should not see "Post a copy to all groups" And I set the following fields to these values: @@ -46,9 +42,7 @@ Feature: Posting to forums in a course with no groups behaves correctly And I should see "Teacher -> All participants" Scenario: Teachers can post in forum with visible groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Visible forum" + Given I am on the "Visible forum" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" Then I should not see "Post a copy to all groups" And I set the following fields to these values: @@ -59,9 +53,7 @@ Feature: Posting to forums in a course with no groups behaves correctly And I should see "Teacher -> All participants" Scenario: Students can post in standard forum - Given I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Standard forum" + Given I am on the "Standard forum" "forum activity" page logged in as student1 When I click on "Add discussion topic" "link" Then I should not see "Post a copy to all groups" And I set the following fields to these values: @@ -72,15 +64,11 @@ Feature: Posting to forums in a course with no groups behaves correctly And I should see "Student -> All participants" Scenario: Students cannot post in forum with separate groups - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Separate forum" + When I am on the "Separate forum" "forum activity" page logged in as student1 Then I should see "You are not able to create a discussion because you are not a member of any group." And I should not see "Add discussion topic" Scenario: Students cannot post in forum with visible groups - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Visible forum" + When I am on the "Visible forum" "forum activity" page logged in as student1 Then I should see "You are not able to create a discussion because you are not a member of any group." And I should not see "Add discussion topic" diff --git a/mod/forum/tests/behat/portfolio_export.feature b/mod/forum/tests/behat/portfolio_export.feature index 0bf6df2fea496..06e78bc3247c5 100644 --- a/mod/forum/tests/behat/portfolio_export.feature +++ b/mod/forum/tests/behat/portfolio_export.feature @@ -16,28 +16,22 @@ Feature: Ensure only users with appropriate permissions can export forum discuss Scenario: A teacher can export discussions to a portfolio. Given the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Test forum 1 | Test forum 2 | C1 | forum | 0 | + | activity | name | course | idnumber | groupmode | + | forum | Test forum 1 | C1 | forum | 0 | And I log in as "admin" And the following config values are set as admin: | enableportfolios | 1 | And I navigate to "Plugins > Portfolios > Manage portfolios" in site administration And I set portfolio instance "File download" to "Enabled and visible" And I click on "Save" "button" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage - And I follow "Test forum 1" + When I am on the "Test forum 1" "forum activity" page logged in as student1 And I add a new discussion to "Test forum 1" forum with: | Subject | Discussion 1 | | Message | Test post message | And I reload the page And I follow "Discussion 1" Then "Export whole discussion to portfolio" "button" should not exist - And I log out - And I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Test forum 1" + And I am on the "Test forum 1" "forum activity" page logged in as teacher1 And I follow "Discussion 1" And "Export whole discussion to portfolio" "button" should exist And I press "Export whole discussion to portfolio" diff --git a/mod/forum/tests/behat/post_to_multiple_groups.feature b/mod/forum/tests/behat/post_to_multiple_groups.feature index 04ec0f8d67752..e5da6205963d2 100644 --- a/mod/forum/tests/behat/post_to_multiple_groups.feature +++ b/mod/forum/tests/behat/post_to_multiple_groups.feature @@ -56,62 +56,34 @@ Feature: A user with access to multiple groups should be able to post a copy of | G1 | C2G1 | | G1 | C2G2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | grouping | - | forum | No group forum | Test forum name | C1 | forum | 0 | | - | forum | Separate group forum | Test forum name | C1 | forum | 1 | | - | forum | Visible group forum | Test forum name | C1 | forum | 2 | | - | forum | Groupings forum | Test forum name | C2 | forum | 1 | G1 | + | activity | name | course | idnumber | groupmode | grouping | + | forum | No group forum | C1 | forum | 0 | | + | forum | Separate group forum | C1 | forum | 1 | | + | forum | Visible group forum | C1 | forum | 2 | | + | forum | Groupings forum | C2 | forum | 1 | G1 | + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | posttomygroups | + | teacher1 | Separate group forum | Discussion 1 | test | 1 | + | teacher1 | Visible group forum | Discussion 1 | test | 1 | Scenario: Teacher is able to post a copy of a message to all groups in a separate group forum - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a new discussion to "Separate group forum" forum with: - | Subject | Discussion 1 | - | Message | test | - | Post a copy to all groups | 1 | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Separate group forum" + When I am on the "Separate group forum" "forum activity" page logged in as student1 Then I should see "Discussion 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Separate group forum" + And I am on the "Separate group forum" "forum activity" page logged in as student2 And I should see "Discussion 1" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage - And I follow "Separate group forum" + And I am on the "Separate group forum" "forum activity" page logged in as student3 And I should see "Discussion 1" Scenario: Teacher is able to post a copy of a message to all groups in a visible group forum - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I add a new discussion to "Visible group forum" forum with: - | Subject | Discussion 1 | - | Message | test | - | Post a copy to all groups | 1 | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Visible group forum" + When I am on the "Visible group forum" "forum activity" page logged in as student1 Then I should see "Discussion 1" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage - And I follow "Visible group forum" + And I am on the "Visible group forum" "forum activity" page logged in as student2 And I should see "Discussion 1" - And I log out - And I log in as "student3" - And I am on "Course 1" course homepage - And I follow "Visible group forum" + And I am on the "Visible group forum" "forum activity" page logged in as student2 And I should see "Discussion 1" Scenario: Teacher is unable to post a copy of a message to all groups in a no group forum - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "No group forum" + Given I am on the "No group forum" "forum activity" page logged in as teacher1 And I click on "Add discussion topic" "link" Then I should not see "Post a copy to all groups" @@ -122,13 +94,7 @@ Feature: A user with access to multiple groups should be able to post a copy of | Subject | Discussion 1 | | Message | test | | Post a copy to all groups | 1 | - And I log out - And I log in as "student1" - And I am on "Course 2" course homepage - When I follow "Groupings forum" + When I am on the "Groupings forum" "forum activity" page logged in as student1 Then I should see "Discussion 1" - And I log out - And I log in as "student2" - And I am on "Course 2" course homepage - And I follow "Groupings forum" + And I am on the "Groupings forum" "forum activity" page logged in as student2 And I should not see "Discussion 1" diff --git a/mod/forum/tests/behat/posts_ordering_general.feature b/mod/forum/tests/behat/posts_ordering_general.feature index ba74c7e41a175..a577be71de4f1 100644 --- a/mod/forum/tests/behat/posts_ordering_general.feature +++ b/mod/forum/tests/behat/posts_ordering_general.feature @@ -20,6 +20,14 @@ Feature: New discussions and discussions with recently added replies are display | course | C1 | | activity | forum | | name | Course general forum | + # + # Add three posts into the blog. + # + And the following forum discussions exist in course "Course 1": + | user | forum | name | message | timemodified | + | student1 | Course general forum | Forum post 1 | This is the first post | ##now +1 second## | + | student1 | Course general forum | Forum post 2 | This is the second post | ##now +2 second## | + | student1 | Course general forum | Forum post 3 | This is the third post | ##now +3 second## | # # We need javascript/wait to prevent creation of the posts in the same second. The threads @@ -30,18 +38,6 @@ Feature: New discussions and discussions with recently added replies are display Scenario: Replying to a forum post or editing it puts the discussion to the front Given I am on the "Course general forum" "forum activity" page logged in as student1 # - # Add three posts into the forum. - # - When I add a new discussion to "Course general forum" forum with: - | Subject | Forum post 1 | - | Message | This is the first post | - And I add a new discussion to "Course general forum" forum with: - | Subject | Forum post 2 | - | Message | This is the second post | - And I add a new discussion to "Course general forum" forum with: - | Subject | Forum post 3 | - | Message | This is the third post | - # # Edit one of the forum posts. # And I follow "Forum post 2" @@ -50,7 +46,6 @@ Feature: New discussions and discussions with recently added replies are display | Subject | Edited forum post 2 | And I press "Save changes" And I wait to be redirected - And I log out # # Reply to another forum post. # diff --git a/mod/forum/tests/behat/private_replies.feature b/mod/forum/tests/behat/private_replies.feature index 003255487a364..9abe1d0d4ec32 100644 --- a/mod/forum/tests/behat/private_replies.feature +++ b/mod/forum/tests/behat/private_replies.feature @@ -15,65 +15,38 @@ Feature: Forum posts can be replied to in private | fullname | shortname | category | | Science 101 | C1 | 0 | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Study discussions | Test forum description | C1 | forum | + | activity | name | course | idnumber | + | forum | Study discussions | C1 | forum | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | | teacher2 | C1 | editingteacher | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "student1" - And I am on "Science 101" course homepage - And I add a new discussion to "Study discussions" forum with: - | Subject | Answers to the homework | - | Message | Here are the answers to last night's homework. | - And I log out - And I log in as "teacher1" - And I am on "Science 101" course homepage + And the following forum discussions exist in course "Science 101": + | user | forum | name | message | + | student1 | Study discussions | Answers to the homework | Here are the answers to last night's homework. | + And I am on the "Science 101" course page logged in as teacher1 And I reply "Answers to the homework" post from "Study discussions" forum with: | Message | How about you and I have a meeting after class about plagiarism? | | Reply privately | 1 | Scenario: As a teacher I can see my own response - Given I follow "Study discussions" - And I follow "Answers to the homework" + Given I am on the "Study discussions" "forum activity" page logged in as teacher1 + When I follow "Answers to the homework" Then I should see "How about you and I have a meeting after class about plagiarism?" Scenario: As a fellow teacher I can see the other teacher's response - Given I log out - And I log in as "teacher2" - And I am on "Science 101" course homepage - And I follow "Study discussions" + Given I am on the "Study discussions" "forum activity" page logged in as teacher2 When I follow "Answers to the homework" Then I should see "How about you and I have a meeting after class about plagiarism?" - Scenario: As the intended recipient I can see private response to me - Given I log out - And I log in as "student1" - And I am on "Science 101" course homepage - And I follow "Study discussions" + Scenario: As the intended recipient I can see my own response + Given I am on the "Study discussions" "forum activity" page logged in as student1 When I follow "Answers to the homework" Then I should see "How about you and I have a meeting after class about plagiarism?" - Scenario: As a non-privileged user I cannot see private response to others - Given I log out - And I log in as "student2" - And I am on "Science 101" course homepage - And I follow "Study discussions" + Scenario: As a non-privileged user I cannot see my own response + Given I am on the "Study discussions" "forum activity" page logged in as student2 When I follow "Answers to the homework" Then I should not see "How about you and I have a meeting after class about plagiarism?" - - Scenario: As privileged user that can post but not read private replies I can see my own private reply - Given I log out - And the following "permission overrides" exist: - | capability | permission | role | contextlevel | reference | - | mod/forum:postprivatereply | Allow | student | System | | - | mod/forum:readprivatereplies | Prohibit | student | System | | - And I log in as "student2" - And I am on "Science 101" course homepage - When I reply "Answers to the homework" post from "Study discussions" forum with: - | Message | Not yet. | - | Reply privately | 1 | - Then I should see "Not yet." - And I should not see "How about you and I have a meeting after class about plagiarism?" diff --git a/mod/forum/tests/behat/recent_activity.feature b/mod/forum/tests/behat/recent_activity.feature index 382e2f02c152b..693c2ab762c2a 100644 --- a/mod/forum/tests/behat/recent_activity.feature +++ b/mod/forum/tests/behat/recent_activity.feature @@ -29,12 +29,12 @@ Feature: Users can see the relevant recent forum posts from the recent activity | teacher1 | G1 | | teacher1 | G2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | type | groupmode | visible | - | forum | Separate groups forum | Separate groups description | C1 | forum1 | general | 1 | 1 | - | forum | Visible groups forum | Visible groups description | C1 | forum2 | general | 2 | 1 | - | forum | Standard forum | Standard description | C1 | forum3 | general | 0 | 1 | - | forum | Hidden forum | Hidden description | C1 | forum4 | general | 0 | 0 | - | forum | Q&A forum | Q&A description | C1 | forum5 | qanda | 0 | 1 | + | activity | name | course | idnumber | type | groupmode | visible | + | forum | Separate groups forum | C1 | forum1 | general | 1 | 1 | + | forum | Visible groups forum | C1 | forum2 | general | 2 | 1 | + | forum | Standard forum | C1 | forum3 | general | 0 | 1 | + | forum | Hidden forum | C1 | forum4 | general | 0 | 0 | + | forum | Q&A forum | C1 | forum5 | qanda | 0 | 1 | And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add the "Recent activity" block @@ -44,13 +44,9 @@ Feature: Users can see the relevant recent forum posts from the recent activity | Subject | Group 1 separate discussion | | Message | Group 1 members only | | Group | Group 1 | - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "Group 1 separate discussion" in the "Recent activity" "block" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I should not see "Group 1 separate discussion" in the "Recent activity" "block" Scenario: Recent forum activity with visible groups discussion @@ -58,13 +54,9 @@ Feature: Users can see the relevant recent forum posts from the recent activity | Subject | Group 1 visible discussion | | Message | Not just for group 1 members | | Group | Group 1 | - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "Group 1 visible discussion" in the "Recent activity" "block" - And I log out - And I log in as "student2" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student2 And I should see "Group 1 visible discussion" in the "Recent activity" "block" Scenario: Recent forum activity with recent post as a private reply @@ -78,30 +70,24 @@ Feature: Users can see the relevant recent forum posts from the recent activity And I am on "Course 1" course homepage And I should see "Standard forum discussion" in the "Recent activity" "block" And I should see "Teacher's private reply" in the "Recent activity" "block" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "Standard forum discussion" in the "Recent activity" "block" But I should not see "Teacher's private reply" in the "Recent activity" "block" Scenario: Recent forum activity with recent post in a hidden forum - Given I add a new discussion to "Hidden forum" forum with: - | Subject | Hidden discussion | - | Message | Should be hidden! | + Given the following forum discussions exist in course "Course 1": + | user | forum | name | message | + | teacher1 | Hidden forum | Hidden discussion | Should be hidden! | And I am on "Course 1" course homepage And I should see "Hidden discussion" in the "Recent activity" "block" - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should not see "Hidden discussion" in the "Recent activity" "block" Scenario: Recent forum activity with question and answer forum Given I add a new question to "Q&A forum" forum with: | Subject | The egg vs the chicken | | Message | Which came first? The egg or the chicken? | - And I log out - And I log in as "student1" - And I am on "Course 1" course homepage + And I am on the "Course 1" course page logged in as student1 And I reply "The egg vs the chicken" post from "Q&A forum" forum with: | Subject | Student 1's answer | | Message | The egg! | @@ -112,9 +98,7 @@ Feature: Users can see the relevant recent forum posts from the recent activity And I log in as "admin" And the following config values are set as admin: | maxeditingtime | 1 | - And I log out - When I log in as "student2" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student2 Then I should see "The egg vs the chicken" in the "Recent activity" "block" But I should not see "Student 1's answer" in the "Recent activity" "block" And I reply "The egg vs the chicken" post from "Q&A forum" forum with: @@ -135,7 +119,5 @@ Feature: Users can see the relevant recent forum posts from the recent activity | timeend[day] | 1 | And I am on "Course 1" course homepage And I should see "Timed discussion" in the "Recent activity" "block" - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should not see "Timed discussion" in the "Recent activity" "block" diff --git a/mod/forum/tests/behat/separate_group_discussions.feature b/mod/forum/tests/behat/separate_group_discussions.feature index 4762a1f9f4986..bbea6ac6d5af1 100644 --- a/mod/forum/tests/behat/separate_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_discussions.feature @@ -46,8 +46,8 @@ Feature: Posting to all groups in a separate group discussion is restricted to u | student2 | G2 | | student3 | G4 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Standard forum name | Standard forum description | C1 | sepgroups | 1 | + | activity | name | course | idnumber | groupmode | + | forum | Standard forum name | C1 | sepgroups | 1 | And the following "mod_forum > discussions" exist: | forum | name | subject | message | group | | sepgroups | Initial Disc ALL | Initial Disc ALL | Disc ALL content | All participants | @@ -56,9 +56,7 @@ Feature: Posting to all groups in a separate group discussion is restricted to u | sepgroups | Initial Disc G3 | Initial Disc G3 | Disc G3 content | G3 | Scenario: Teacher with accessallgroups can view all groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as teacher1 Then the "Separate groups" select box should contain "All participants" And the "Separate groups" select box should contain "Group A" And the "Separate groups" select box should contain "Group B" @@ -80,10 +78,8 @@ Feature: Posting to all groups in a separate group discussion is restricted to u But I should not see "Initial Disc G1" And I should not see "Initial Disc G3" - Scenario: Teacher with accessallgroups can select any participation group when posting - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Scenario: Teacher with accessallgroups can select any group when posting + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should contain "All participants" @@ -94,9 +90,7 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should see "Post a copy to all groups" Scenario: Teacher with accessallgroups can post in groups they are a member of - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 And I select "Group A" from the "Separate groups" singleselect When I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -125,9 +119,7 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should not see "Teacher 1 -> Group B" Scenario: Teacher with accessallgroups can post in groups they are not a member of - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 And I select "Group A" from the "Separate groups" singleselect When I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -156,9 +148,7 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should not see "Teacher 1 -> Group C" Scenario: Teacher with accessallgroups can post to all groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" And I set the following fields to these values: @@ -184,9 +174,7 @@ Feature: Posting to all groups in a separate group discussion is restricted to u # No point testing the "All participants". Scenario: Students in one group can only post in their group - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student1 Then I should see "Group A" And I click on "Add discussion topic" "link" And I should see "Group A" @@ -202,27 +190,21 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should not see "Group B" in the "Student -> B" "table_row" Scenario: Students in no group can see all group discussions, but not post. - Given I log in as "student4" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student4 Then I should see "All participants" And I should see "Initial Disc ALL" And I should see "You are not able to create a discussion" And I should not see "Add discussion topic" Scenario: Students in non-participation groups can see all group discussions, but not post. - Given I log in as "student3" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student3 Then I should see "All participants" And I should see "Initial Disc ALL" And I should see "You are not able to create a discussion" And I should not see "Add discussion topic" Scenario: Students in multiple group can post in all of their group individually - Given I log in as "student2" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student2 And I select "Group A" from the "Separate groups" singleselect And I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -266,13 +248,10 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should not see "Student -> A" Scenario: Teacher in all groups but without accessallgroups can only post in their groups - And I log in as "admin" + Given I log in as "admin" And I set the following system permissions of "Non-editing teacher" role: | moodle/site:accessallgroups | Prohibit | - And I log out - Given I log in as "noneditor1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + And I am on the "Standard forum name" "forum activity" page logged in as noneditor1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should not contain "All participants" @@ -281,13 +260,10 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should see "Post a copy to all groups" Scenario: Teacher in some groups and without accessallgroups can only post in their groups - And I log in as "admin" + Given I log in as "admin" And I set the following system permissions of "Non-editing teacher" role: | moodle/site:accessallgroups | Prohibit | - And I log out - Given I log in as "noneditor1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + And I am on the "Standard forum name" "forum activity" page logged in as noneditor1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should not contain "All participants" @@ -296,7 +272,5 @@ Feature: Posting to all groups in a separate group discussion is restricted to u And I should see "Post a copy to all groups" Scenario: Students can view all participants discussions in separate groups mode - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student1 Then I should see "Initial Disc ALL" diff --git a/mod/forum/tests/behat/separate_group_grade_forum.feature b/mod/forum/tests/behat/separate_group_grade_forum.feature index 5a7acb3471e02..c2360b30d6f2c 100644 --- a/mod/forum/tests/behat/separate_group_grade_forum.feature +++ b/mod/forum/tests/behat/separate_group_grade_forum.feature @@ -32,18 +32,20 @@ Feature: I can grade a students by group with separate groups | student1 | G3 | | student2 | G3 | | student3 | G3 | + And the following "activity" exists: + | activity | forum | + | course | C1 | + | name | Test Forum 1 | And I log in as "teacher1" - And I am on "Course 1" course homepage - And I turn editing mode on - And I add a "Forum" to section "1" + And I am on "Course 1" course homepage with editing mode on + And I am on the "Test Forum 1" "forum activity editing" page And I expand all fieldsets And I set the following fields to these values: | Forum name | Test Forum 1 | | Description | Test | And I set the field "Whole forum grading > Type" to "Point" And I set the field "Common module settings > Group mode" to "Separate groups" - And I press "Save and return to course" - And I am on the "Test Forum 1" "forum activity" page + And I press "Save and display" @javascript Scenario: Grade users by group A @@ -85,7 +87,6 @@ Feature: I can grade a students by group with separate groups | user | group | | teacher2 | G2 | | teacher2 | G3 | - And I log out When I am on the "Test Forum 1" "forum activity" page logged in as student1 And I select "Group A" from the "Separate groups" singleselect And I click on "Add discussion topic" "link" @@ -99,7 +100,6 @@ Feature: I can grade a students by group with separate groups | Subject | Discussion subject C | | Message | Discussion message C | And I press "Post to forum" - And I log out Then I am on the "Test Forum 1" "forum activity" page logged in as teacher2 And I select "Group C" from the "Separate groups" singleselect And I click on "Grade users" "button" diff --git a/mod/forum/tests/behat/separate_group_single_group_discussions.feature b/mod/forum/tests/behat/separate_group_single_group_discussions.feature index c302f7727dc9b..6ddf9a37cce9a 100644 --- a/mod/forum/tests/behat/separate_group_single_group_discussions.feature +++ b/mod/forum/tests/behat/separate_group_single_group_discussions.feature @@ -39,21 +39,18 @@ Feature: Posting to groups in a separate group discussion when restricted to gro | G1 | G1G2 | | G2 | G2G1 | And the following "activities" exist: - | activity | course | idnumber | name | intro | type | section | groupmode | grouping | - | forum | C1 | 00001 | Multiple groups forum | Standard forum description | general | 1 | 1 | G1 | - | forum | C1 | 00001 | Single groups forum | Standard forum description | general | 1 | 1 | G2 | + | activity | course | idnumber | name | type | groupmode | grouping | + | forum | C1 | 00001 | Multiple groups forum | general | 1 | G1 | + | forum | C1 | 00001 | Single groups forum | general | 1 | G2 | Scenario: Teacher with accessallgroups can post in all groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Multiple groups forum" + Given I am on the "Multiple groups forum" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should contain "All participants" And the "Group" select box should contain "G1G1" And the "Group" select box should contain "G1G2" - And I am on "Course 1" course homepage - And I follow "Single groups forum" + And I am on the "Single groups forum" "forum activity" page And I click on "Add discussion topic" "link" And I click on "Advanced" "button" And the "Group" select box should contain "All participants" @@ -61,16 +58,13 @@ Feature: Posting to groups in a separate group discussion when restricted to gro And I should not see "Post a copy to all groups" Scenario: Teacher in all groups but without accessallgroups can post in either group but not to All Participants - Given I log in as "teacher2" - And I am on "Course 1" course homepage - And I follow "Multiple groups forum" + Given I am on the "Multiple groups forum" "forum activity" page logged in as teacher2 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should not contain "All participants" And the "Group" select box should contain "G1G1" And the "Group" select box should contain "G1G2" - And I am on "Course 1" course homepage - And I follow "Single groups forum" + And I am on the "Single groups forum" "forum activity" page And I click on "Add discussion topic" "link" And I click on "Advanced" "button" And I should see "G2G1" diff --git a/mod/forum/tests/behat/single_forum_discussion.feature b/mod/forum/tests/behat/single_forum_discussion.feature index 7caa2d374bc00..6c05ff02a02e3 100644 --- a/mod/forum/tests/behat/single_forum_discussion.feature +++ b/mod/forum/tests/behat/single_forum_discussion.feature @@ -21,15 +21,12 @@ Feature: Single simple forum discussion type | forum | Single discussion forum name | Single discussion forum description | single | C1 | forum | Scenario: Teacher can start the single simple discussion - Given I log in as "teacher1" - And I am on "Course 1" course homepage - When I follow "Single discussion forum name" + When I am on the "Single discussion forum name" "forum activity" page logged in as teacher1 Then I should see "Single discussion forum description" in the "div.firstpost.starter" "css_element" And I should not see "Add a new discussion topic" Scenario: Student can not add more discussions - And I log in as "student1" - And I am on "Course 1" course homepage + Given I am on the "Course 1" course page logged in as student1 When I reply "Single discussion forum name" post from "Single discussion forum name" forum with: | Subject | Reply to single discussion subject | | Message | Reply to single discussion message | diff --git a/mod/forum/tests/behat/split_forum_discussion.feature b/mod/forum/tests/behat/split_forum_discussion.feature index 51e8a4efb4710..6cd2081310dd6 100644 --- a/mod/forum/tests/behat/split_forum_discussion.feature +++ b/mod/forum/tests/behat/split_forum_discussion.feature @@ -19,34 +19,24 @@ Feature: Forum discussions can be split | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | type | - | forum | Study discussions | Forum to discuss your coursework. | C1 | forump1 | general | - And I log in as "teacher1" - And I am on "Science 101" course homepage - And I add a new discussion to "Study discussions" forum with: - | Subject | Photosynthesis discussion | - | Message | Lets discuss our learning about Photosynthesis this week in this thread. | - And I log out - And I log in as "student1" - And I am on "Science 101" course homepage - And I reply "Photosynthesis discussion" post from "Study discussions" forum with: - | Message | Can anyone tell me which number is the mass number in the periodic table? | - And I log out - And I log in as "student2" - And I am on "Science 101" course homepage - And I follow "Study discussions" + | activity | name | course | idnumber | type | + | forum | Study discussions | C1 | forump1 | general | + And the following "mod_forum > discussions" exist: + | forum | course | user | name | message | + | forump1 | C1 | teacher1 | Photosynthesis discussion | Lets discuss our learning about Photosynthesis this week in this thread. | + And the following "mod_forum > posts" exist: + | user | parentsubject | message | + | student1 | Photosynthesis discussion | Can anyone tell me which number is the mass number in the periodic table? | + And I am on the "Study discussions" "forum activity" page logged in as student2 And I follow "Photosynthesis discussion" And I click on "Reply" "link" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' forumpost ')][contains(., 'Can anyone tell me which number is the mass number in the periodic table?')]" "xpath_element" And I wait to be redirected And I set the following fields to these values: | Message | I would also like to know this | And I press "Post to forum" - And I log out Scenario: Split a forum discussion - Given I log in as "teacher1" - And I am on "Science 101" course homepage - And I follow "Study discussions" + Given I am on the "Study discussions" "forum activity" page logged in as teacher1 And I follow "Photosynthesis discussion" When I follow "Split" And I set the following fields to these values: diff --git a/mod/forum/tests/behat/timed_discussions.feature b/mod/forum/tests/behat/timed_discussions.feature index 2e238790b89e5..15cb6bd991d68 100644 --- a/mod/forum/tests/behat/timed_discussions.feature +++ b/mod/forum/tests/behat/timed_discussions.feature @@ -15,8 +15,8 @@ Feature: Users can choose to set start and end time for display of their discuss | user | course | role | | student1 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | type | - | forum | Test forum name | Test forum description | C1 | forump1 | general | + | activity | name | course | idnumber | type | + | forum | Test forum name | C1 | forump1 | general | And I log in as "admin" And the following config values are set as admin: | forum_enabletimedposts | 1 | @@ -33,15 +33,11 @@ Feature: Users can choose to set start and end time for display of their discuss | Subject | Discussion 3 timed visible now | | Message | Discussion contents 3, first message | | timestart[enabled] | 1 | - And I am on "Course 1" course homepage - And I follow "Test forum name" + And I am on the "Test forum name" "forum activity" page And I should see "Discussion 2 timed" And I should see "Discussion 3 timed" And "[data-region=timed-label]" "css_element" should exist - And I log out - And I log in as "student1" - When I am on "Course 1" course homepage - And I follow "Test forum name" + When I am on the "Test forum name" "forum activity" page logged in as student1 Then I should see "Discussion 1" And I should not see "Discussion 2 timed" And "[data-region=timed-label]" "css_element" should not exist diff --git a/mod/forum/tests/behat/track_read_posts.feature b/mod/forum/tests/behat/track_read_posts.feature index 3eabca865fdfd..dd438fa203447 100644 --- a/mod/forum/tests/behat/track_read_posts.feature +++ b/mod/forum/tests/behat/track_read_posts.feature @@ -16,45 +16,41 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | user | course | role | | student1 | C1 | student | | student2 | C1 | student | - And I log in as "admin" Scenario: Tracking forum posts off Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | 00001 | - | name | Test forum name | - | intro | Test forum description | - | section | 1 | - | trackingtype | 0 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | type | general | + | name | Test forum name | + | trackingtype | 0 | + And the following "mod_forum > discussion" exists: + | forum | forum1 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | + When I am on the "Course 1" course page logged in as student1 Then I should not see "1 unread post" And I follow "Test forum name" And I should not see "Track unread posts" Scenario: Tracking forum posts optional with user tracking on Given the following "activity" exists: - | activity | forum | - | course | C1 | - | idnumber | 00001 | - | name | Test forum name | - | intro | Test forum description | - | section | 1 | - | type | generalforum | - | trackingtype | 1 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + | activity | forum | + | course | C1 | + | idnumber | forum1 | + | name | Test forum name | + | type | general | + | trackingtype | 1 | + And the following "mod_forum > discussion" exists: + | forum | forum1 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | + When I am on the "Course 1" course page logged in as student1 Then I should see "1 unread post" And I follow "Test forum name" And I follow "Don't track unread posts" @@ -74,17 +70,15 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | course | C1 | | idnumber | 00001 | | name | Test forum name | - | intro | Test forum description | - | section | 1 | - | type | generalforum | + | type | general | | trackingtype | 1 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student2" - And I am on "Course 1" course homepage + And the following "mod_forum > discussion" exists: + | forum | 00001 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | + When I am on the "Course 1" course page logged in as student2 Then I should not see "1 unread post" And I follow "Test forum name" And I should not see "Track unread posts" @@ -97,17 +91,15 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | course | C1 | | idnumber | 00001 | | name | Test forum name | - | intro | Test forum description | - | section | 1 | - | type | generalforum | + | type | general | | trackingtype | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + And the following "mod_forum > discussion" exists: + | forum | 00001 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | + When I am on the "Course 1" course page logged in as student1 Then I should see "1 unread post" And I am on the "Test forum name" "forum activity" page And I should not see "Don't track unread posts" @@ -123,17 +115,15 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | course | C1 | | idnumber | 00001 | | name | Test forum name | - | intro | Test forum description | - | section | 1 | - | type | generalforum | + | type | general | | trackingtype | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | - And I log out - When I log in as "student2" - And I am on "Course 1" course homepage + And the following "mod_forum > discussion" exists: + | forum | 00001 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | + When I am on the "Course 1" course page logged in as student2 Then I should see "1 unread post" And I am on the "Test forum name" "forum activity" page And I should not see "Don't track unread posts" @@ -149,19 +139,17 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | course | C1 | | idnumber | 00001 | | name | Test forum name | - | description | Test forum description | - | section | 1 | - | type | generalforum | + | type | general | | trackingtype | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | + And the following "mod_forum > discussion" exists: + | forum | 00001 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | And the following config values are set as admin: | forum_allowforcedreadtracking | 0 | - And I log out - When I log in as "student1" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student1 Then I should see "1 unread post" And I follow "Test forum name" And I follow "Don't track unread posts" @@ -183,19 +171,17 @@ Feature: A teacher can set one of 3 possible options for tracking read forum pos | course | C1 | | idnumber | 00001 | | name | Test forum name | - | description | Test forum description | - | section | 1 | - | type | generalforum | + | type | general | | trackingtype | 2 | - And I am on "Course 1" course homepage - And I add a new discussion to "Test forum name" forum with: - | Subject | Test post subject | - | Message | Test post message | + And the following "mod_forum > discussion" exists: + | forum | 00001 | + | course | C1 | + | user | admin | + | name | Test post subject | + | message | Test post message | And the following config values are set as admin: | forum_allowforcedreadtracking | 0 | - And I log out - When I log in as "student2" - And I am on "Course 1" course homepage + When I am on the "Course 1" course page logged in as student2 Then I should not see "1 unread post" And I follow "Test forum name" And I should not see "Track unread posts" diff --git a/mod/forum/tests/behat/visible_group_discussions.feature b/mod/forum/tests/behat/visible_group_discussions.feature index 4c33d7c74cfee..482a562df5003 100644 --- a/mod/forum/tests/behat/visible_group_discussions.feature +++ b/mod/forum/tests/behat/visible_group_discussions.feature @@ -37,8 +37,8 @@ Feature: Posting to all groups in a visible group discussion is restricted to us | student2 | G2 | | student3 | G4 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | Standard forum name | Standard forum description | C1 | groups | 2 | + | activity | name | course | idnumber | groupmode | + | forum | Standard forum name | C1 | groups | 2 | And the following "mod_forum > discussions" exist: | forum | name | subject | message | group | | groups | Initial Disc ALL | Initial Disc ALL | Disc ALL content | All participants | @@ -47,9 +47,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us | groups | Initial Disc G3 | Initial Disc G3 | Disc G3 content | G3 | Scenario: Teacher with accessallgroups can view all groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as teacher1 Then the "Visible groups" select box should contain "All participants" And the "Visible groups" select box should contain "Group A" And the "Visible groups" select box should contain "Group B" @@ -72,9 +70,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should not see "Initial Disc G3" Scenario: Teacher with accessallgroups can select any group when posting - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" Then the "Group" select box should contain "All participants" @@ -85,9 +81,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should see "Post a copy to all groups" Scenario: Teacher with accessallgroups can post in groups they are a member of - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 And I select "Group A" from the "Visible groups" singleselect When I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -116,9 +110,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should not see "Teacher 1 -> Group B" Scenario: Teacher with accessallgroups can post in groups they are not a member of - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 And I select "Group A" from the "Visible groups" singleselect When I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -147,9 +139,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should not see "Teacher 1 -> Group C" Scenario: Teacher with accessallgroups can post to all groups - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I follow "Standard forum name" + Given I am on the "Standard forum name" "forum activity" page logged in as teacher1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" And I set the following fields to these values: @@ -175,9 +165,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us # No point testing the "All participants". Scenario: Students can view all groups - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student1 Then the "Visible groups" select box should contain "All participants" And the "Visible groups" select box should contain "Group A" And the "Visible groups" select box should contain "Group B" @@ -200,9 +188,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should not see "Initial Disc G3" Scenario: Students in one group can only post in their group - Given I log in as "student1" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student1 Then I should see "Group A" And I click on "Add discussion topic" "link" And I click on "Advanced" "button" @@ -220,9 +206,7 @@ Feature: Posting to all groups in a visible group discussion is restricted to us And I should not see "Group B" in the "Student -> B" "table_row" Scenario: Students in multiple group can post in all of their group individually - Given I log in as "student2" - And I am on "Course 1" course homepage - When I follow "Standard forum name" + When I am on the "Standard forum name" "forum activity" page logged in as student2 And I select "Group A" from the "Visible groups" singleselect And I click on "Add discussion topic" "link" And I click on "Advanced" "button" diff --git a/report/outline/tests/behat/filter.feature b/report/outline/tests/behat/filter.feature index e5571df51110b..e6783611e0b01 100644 --- a/report/outline/tests/behat/filter.feature +++ b/report/outline/tests/behat/filter.feature @@ -19,16 +19,15 @@ Feature: Filter an outline report | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | description | course | idnumber | section | - | forum | Forum name | Forum description | C1 | FORUM01 | 1 | - | book | Book name | | C1 | BOOK01 | 1 | + | activity | name | course | idnumber | section | + | forum | Forum name | C1 | FORUM01 | 1 | + | book | Book name | C1 | BOOK01 | 1 | When I am on the "Course 1" course page logged in as admin Scenario: Filter the outline report by start date Given I navigate to "Plugins > Logging > Manage log stores" in site administration And "Disable" "link" should exist in the "Standard log" "table_row" - And I am on the "Course 1" course page logged in as student1 - And I follow "Forum name" + And I am on the "Forum name" "forum activity" page logged in as student1 And the log timestamp for "student1" and "FORUM01" is set to "12 June 2017 12:49:00" And I am on "Course 1" course homepage And I follow "Book name" @@ -52,8 +51,7 @@ Feature: Filter an outline report Scenario: Filter the outline report by end date Given I navigate to "Plugins > Logging > Manage log stores" in site administration And "Disable" "link" should exist in the "Standard log" "table_row" - And I am on the "Course 1" course page logged in as student1 - And I follow "Forum name" + And I am on the "Forum name" "forum activity" page logged in as student1 And the log timestamp for "student1" and "FORUM01" is set to "12 June 2017 12:49:00" And I am on "Course 1" course homepage And I follow "Book name" diff --git a/report/outline/tests/behat/outline.feature b/report/outline/tests/behat/outline.feature index 2e0e647de9548..f9e8b492c3212 100644 --- a/report/outline/tests/behat/outline.feature +++ b/report/outline/tests/behat/outline.feature @@ -19,9 +19,9 @@ Feature: View an outline report | student1 | C1 | student | | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | forum | Forum name | Forum description | C1 | forum1 | - | book | Book name | | C1 | book1 | + | activity | name | course | idnumber | + | forum | Forum name | C1 | forum1 | + | book | Book name | C1 | book1 | When I am on the "Course 1" course page logged in as admin Scenario: View the outline report when only the standard log reader is enabled diff --git a/report/outline/tests/behat/user.feature b/report/outline/tests/behat/user.feature index 20d1c4f76af5b..6cc1318f62004 100644 --- a/report/outline/tests/behat/user.feature +++ b/report/outline/tests/behat/user.feature @@ -53,8 +53,8 @@ Feature: View the user page for the outline report Scenario: View the user complete report page when there is a no-grade forum Given the following "activities" exist: - | activity | name | description | course | idnumber | - | forum | forum1 | C1 first forum | C1 | forum1 | + | activity | name | course | idnumber | + | forum | forum1 | C1 | forum1 | And I am on "Course 1" course homepage When I follow "Participants" And I follow "Student 1" diff --git a/repository/contentbank/tests/behat/select_content.feature b/repository/contentbank/tests/behat/select_content.feature index f62718fe1ba38..0b4920851fc73 100644 --- a/repository/contentbank/tests/behat/select_content.feature +++ b/repository/contentbank/tests/behat/select_content.feature @@ -30,7 +30,7 @@ Feature: Select content bank files using the content bank files repository | System | | contenttype_h5p | admin | filltheblanks.h5p | /h5p/tests/fixtures/filltheblanks.h5p | And the following "activities" exist: | activity | name | intro | introformat | course | idnumber | - | forum | Forum | ForumDesc | 1 | mscC1 | forum1 | + | forum | Forum | | 1 | mscC1 | forum1 | | folder | Folder | FolderDesc | 1 | mscC1 | folder1 | And the following "course enrolments" exist: | user | course | role | diff --git a/search/tests/behat/search_query.feature b/search/tests/behat/search_query.feature index b70a1250300a6..97648cc45c406 100644 --- a/search/tests/behat/search_query.feature +++ b/search/tests/behat/search_query.feature @@ -101,8 +101,8 @@ Feature: Use global search interface | A Group | F1 | G1 | | B Group | F1 | G2 | And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | forum | ForumSG | ForumDesc1 | F1 | FORUM2 | 1 | + | activity | name | course | idnumber | groupmode | + | forum | ForumSG | F1 | FORUM2 | 1 | When I am on the ForumSG "Forum activity" page And global search expects the query "frogs" and will return: | type | idnumber |