From aa306e7bc8cae9ec08f769fe48003ce0ad5a1b8a Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Mon, 23 Nov 2015 11:11:27 +0000 Subject: [PATCH] MDL-52219 behat: remove steps which turn on avaibility/completion Now its the default, we can reduce test time by relying on the default state rather than going around turning it on --- .../tests/behat/manage_conditions.feature | 4 ++-- .../behat/availability_completion.feature | 3 --- .../tests/behat/conditional_bug.feature | 3 --- .../date/tests/behat/availability_date.feature | 2 -- .../tests/behat/availability_grade.feature | 2 -- .../tests/behat/availability_group.feature | 2 -- .../tests/behat/availability_grouping.feature | 2 -- .../tests/behat/availability_profile.feature | 2 -- .../tests/behat/display_availability.feature | 2 -- .../tests/behat/edit_availability.feature | 18 ++++++++---------- badges/tests/behat/award_badge.feature | 4 ---- .../tests/behat/structural_changes.feature | 4 +--- .../behat/enable_manual_complete_mark.feature | 3 --- .../behat/restrict_activity_by_date.feature | 2 -- .../behat/restrict_activity_by_grade.feature | 2 -- .../restrict_section_availability.feature | 3 --- .../behat/teacher_manual_completion.feature | 4 ---- .../behat/activities_edit_completion.feature | 2 -- .../tests/behat/show_nonrespondents.feature | 2 -- ...letion_condition_number_discussions.feature | 3 --- .../forum_subscriptions_availability.feature | 2 -- .../completion_condition_end_reached.feature | 2 -- .../completion_condition_time_spent.feature | 2 -- .../completion_condition_attempts_used.feature | 1 - .../completion_condition_passing_grade.feature | 1 - 25 files changed, 11 insertions(+), 66 deletions(-) diff --git a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature index 9234feee711..65b0b4a398b 100644 --- a/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature +++ b/admin/tool/availabilityconditions/tests/behat/manage_conditions.feature @@ -8,6 +8,8 @@ Feature: Manage availability conditions Scenario: Display list of availability conditions # Check the report doesn't show when not enabled. Given I log in as "admin" + And the following config values are set as admin: + | enableavailability | 0 | And I expand "Site administration" node When I expand "Plugins" node Then I should not see "Availability restrictions" @@ -28,8 +30,6 @@ Feature: Manage availability conditions Given the following "courses" exist: | fullname | shortname | format | | Course 1 | C1 | topics | - And the following config values are set as admin: - | enableavailability | 1 | And I log in as "admin" And I am on site homepage When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions" diff --git a/availability/condition/completion/tests/behat/availability_completion.feature b/availability/condition/completion/tests/behat/availability_completion.feature index 3d95470d4b1..507ba1bb6c7 100644 --- a/availability/condition/completion/tests/behat/availability_completion.feature +++ b/availability/condition/completion/tests/behat/availability_completion.feature @@ -16,9 +16,6 @@ Feature: availability_completion | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | - | enablecompletion | 1 | @javascript Scenario: Test condition diff --git a/availability/condition/completion/tests/behat/conditional_bug.feature b/availability/condition/completion/tests/behat/conditional_bug.feature index b7f6fec1135..402afdd9e6e 100644 --- a/availability/condition/completion/tests/behat/conditional_bug.feature +++ b/availability/condition/completion/tests/behat/conditional_bug.feature @@ -14,9 +14,6 @@ Feature: Confirm that conditions on completion no longer cause a bug And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - And the following config values are set as admin: - | enableavailability | 1 | - | enablecompletion | 1 | @javascript Scenario: Multiple completion conditions on glossary diff --git a/availability/condition/date/tests/behat/availability_date.feature b/availability/condition/date/tests/behat/availability_date.feature index 925781d57c4..161080fe725 100644 --- a/availability/condition/date/tests/behat/availability_date.feature +++ b/availability/condition/date/tests/behat/availability_date.feature @@ -16,8 +16,6 @@ Feature: availability_date | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Test condition diff --git a/availability/condition/grade/tests/behat/availability_grade.feature b/availability/condition/grade/tests/behat/availability_grade.feature index 967e7c80bf3..9c250e12b05 100644 --- a/availability/condition/grade/tests/behat/availability_grade.feature +++ b/availability/condition/grade/tests/behat/availability_grade.feature @@ -16,8 +16,6 @@ Feature: availability_grade | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Test condition diff --git a/availability/condition/group/tests/behat/availability_group.feature b/availability/condition/group/tests/behat/availability_group.feature index d3c2b06d416..31d65d21026 100644 --- a/availability/condition/group/tests/behat/availability_group.feature +++ b/availability/condition/group/tests/behat/availability_group.feature @@ -16,8 +16,6 @@ Feature: availability_group | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Test condition diff --git a/availability/condition/grouping/tests/behat/availability_grouping.feature b/availability/condition/grouping/tests/behat/availability_grouping.feature index e33b5880e9e..3c1ccb1ad38 100644 --- a/availability/condition/grouping/tests/behat/availability_grouping.feature +++ b/availability/condition/grouping/tests/behat/availability_grouping.feature @@ -22,8 +22,6 @@ Feature: availability_grouping And the following "group members" exist: | user | group | | student1 | GI1 | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Test condition diff --git a/availability/condition/profile/tests/behat/availability_profile.feature b/availability/condition/profile/tests/behat/availability_profile.feature index ba207a18f69..2222fb7b74d 100644 --- a/availability/condition/profile/tests/behat/availability_profile.feature +++ b/availability/condition/profile/tests/behat/availability_profile.feature @@ -16,8 +16,6 @@ Feature: availability_profile | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Test condition diff --git a/availability/tests/behat/display_availability.feature b/availability/tests/behat/display_availability.feature index ea70a058316..0daeee26e5b 100644 --- a/availability/tests/behat/display_availability.feature +++ b/availability/tests/behat/display_availability.feature @@ -34,8 +34,6 @@ Feature: display_availability | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | @javascript Scenario: Activity availability display diff --git a/availability/tests/behat/edit_availability.feature b/availability/tests/behat/edit_availability.feature index 0af20b5a376..08a6f70c696 100644 --- a/availability/tests/behat/edit_availability.feature +++ b/availability/tests/behat/edit_availability.feature @@ -29,6 +29,8 @@ Feature: edit_availability | student1 | C1 | student | Scenario: Confirm the 'enable availability' option is working + Given the following config values are set as admin: + | enableavailability | 0 | When I log in as "teacher1" And I am on site homepage And I follow "Course 1" @@ -55,9 +57,7 @@ Feature: edit_availability @javascript Scenario: Edit availability using settings in activity form # Set up. - Given the following config values are set as admin: - | enableavailability | 1 | - And I log in as "teacher1" + Given I log in as "teacher1" And I follow "Course 1" # Add a Page and check it has None in so far. @@ -148,9 +148,7 @@ Feature: edit_availability @javascript Scenario: Edit availability using settings in section form # Set up. - Given the following config values are set as admin: - | enableavailability | 1 | - And I log in as "teacher1" + Given I log in as "teacher1" And I am on site homepage And I follow "Course 1" And I turn editing mode on @@ -170,7 +168,9 @@ Feature: edit_availability @javascript Scenario: 'Add group/grouping access restriction' button unavailable # Button does not exist when conditional access restrictions are turned off. - Given I log in as "admin" + Given the following config values are set as admin: + | enableavailability | 0 | + And I log in as "admin" And I am on site homepage And I follow "Course 1" And I turn editing mode on @@ -181,9 +181,7 @@ Feature: edit_availability @javascript Scenario: Use the 'Add group/grouping access restriction' button # Button should initially be disabled. - Given the following config values are set as admin: - | enableavailability | 1 | - And the following "groupings" exist: + Given the following "groupings" exist: | name | course | idnumber | | GX1 | C1 | GXI1 | And I log in as "admin" diff --git a/badges/tests/behat/award_badge.feature b/badges/tests/behat/award_badge.feature index 4bb0a663dad..0b68bd7c33e 100644 --- a/badges/tests/behat/award_badge.feature +++ b/badges/tests/behat/award_badge.feature @@ -129,8 +129,6 @@ Feature: Award badges | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "teacher1" And I follow "Course 1" And I follow "Edit settings" @@ -180,8 +178,6 @@ Feature: Award badges | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "teacher1" And I follow "Course 1" And I follow "Edit settings" diff --git a/blocks/recent_activity/tests/behat/structural_changes.feature b/blocks/recent_activity/tests/behat/structural_changes.feature index 4340c6046cc..a43dbb79206 100644 --- a/blocks/recent_activity/tests/behat/structural_changes.feature +++ b/blocks/recent_activity/tests/behat/structural_changes.feature @@ -46,9 +46,7 @@ Feature: View structural changes in recent activity block | GG3 | G2 | Scenario: Check that Added module information is displayed respecting view capability - Given the following config values are set as admin: - | enableavailability | 1 | - And I log in as "teacher1" + Given I log in as "teacher1" And I follow "Course 1" And I turn editing mode on When I add a "Forum" to section "1" and I fill the form with: diff --git a/completion/tests/behat/enable_manual_complete_mark.feature b/completion/tests/behat/enable_manual_complete_mark.feature index 93ba9766e80..75a11a2f0c0 100644 --- a/completion/tests/behat/enable_manual_complete_mark.feature +++ b/completion/tests/behat/enable_manual_complete_mark.feature @@ -17,9 +17,6 @@ Feature: Allow students to manually mark an activity as complete | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | - | enableavailability | 1 | And I log in as "teacher1" And I am on site homepage And I follow "Course 1" diff --git a/completion/tests/behat/restrict_activity_by_date.feature b/completion/tests/behat/restrict_activity_by_date.feature index fc3033dca41..5d19955bf37 100644 --- a/completion/tests/behat/restrict_activity_by_date.feature +++ b/completion/tests/behat/restrict_activity_by_date.feature @@ -16,8 +16,6 @@ Feature: Restrict activity availability through date conditions | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | And I log in as "teacher1" And I am on site homepage And I follow "Course 1" diff --git a/completion/tests/behat/restrict_activity_by_grade.feature b/completion/tests/behat/restrict_activity_by_grade.feature index 3b0a60f267a..27fa4234cde 100644 --- a/completion/tests/behat/restrict_activity_by_grade.feature +++ b/completion/tests/behat/restrict_activity_by_grade.feature @@ -17,8 +17,6 @@ Feature: Restrict activity availability through grade conditions | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enableavailability | 1 | And I log in as "teacher1" #And I am on site homepage And I follow "Course 1" diff --git a/completion/tests/behat/restrict_section_availability.feature b/completion/tests/behat/restrict_section_availability.feature index 436c63d4d92..3a74723dd08 100644 --- a/completion/tests/behat/restrict_section_availability.feature +++ b/completion/tests/behat/restrict_section_availability.feature @@ -16,9 +16,6 @@ Feature: Restrict sections availability through completion or grade conditions | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | - | enableavailability | 1 | @javascript Scenario: Show section greyed-out to student when completion condition is not satisfied diff --git a/completion/tests/behat/teacher_manual_completion.feature b/completion/tests/behat/teacher_manual_completion.feature index 3b8c4d4f391..c1ce408f182 100644 --- a/completion/tests/behat/teacher_manual_completion.feature +++ b/completion/tests/behat/teacher_manual_completion.feature @@ -16,11 +16,7 @@ Feature: Allow teachers to manually mark users as complete when configured | user | course | role | | student1 | CC1 | student | | teacher1 | CC1 | editingteacher | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "admin" - And I set the following administration settings values: - | Enable completion tracking | 1 | And I am on site homepage And I follow "Completion course" And completion tracking is "Enabled" in current course diff --git a/course/tests/behat/activities_edit_completion.feature b/course/tests/behat/activities_edit_completion.feature index b264ea4875e..50878cc00d9 100644 --- a/course/tests/behat/activities_edit_completion.feature +++ b/course/tests/behat/activities_edit_completion.feature @@ -8,8 +8,6 @@ Feature: Edit completion settings of an activity Given the following "courses" exist: | fullname | shortname | enablecompletion | | Course 1 | C1 | 1 | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "admin" And I am on site homepage And I follow "Course 1" diff --git a/mod/feedback/tests/behat/show_nonrespondents.feature b/mod/feedback/tests/behat/show_nonrespondents.feature index 30bfc6e62db..6de0a2349b7 100644 --- a/mod/feedback/tests/behat/show_nonrespondents.feature +++ b/mod/feedback/tests/behat/show_nonrespondents.feature @@ -33,8 +33,6 @@ Feature: Show users who have not responded to the feedback survey And the following "grouping groups" exist: | grouping | group | | GXI1 | GI1 | - And the following config values are set as admin: - | enableavailability | 1 | And I log in as "admin" And I navigate to "Manage activities" node in "Site administration > Plugins > Activity modules" And I click on "Show" "link" in the "Feedback" "table_row" diff --git a/mod/forum/tests/behat/completion_condition_number_discussions.feature b/mod/forum/tests/behat/completion_condition_number_discussions.feature index ce20f61836e..1089efe124e 100644 --- a/mod/forum/tests/behat/completion_condition_number_discussions.feature +++ b/mod/forum/tests/behat/completion_condition_number_discussions.feature @@ -16,9 +16,6 @@ Feature: Set a certain number of discussions as a completion condition for a for | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | - | enableavailability | 1 | And I log in as "teacher1" And I follow "Course 1" And I turn editing mode on diff --git a/mod/forum/tests/behat/forum_subscriptions_availability.feature b/mod/forum/tests/behat/forum_subscriptions_availability.feature index 2b6a121a460..4d8a5df03f7 100644 --- a/mod/forum/tests/behat/forum_subscriptions_availability.feature +++ b/mod/forum/tests/behat/forum_subscriptions_availability.feature @@ -34,8 +34,6 @@ 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 config values are set as admin: - | enableavailability | 1 | And I log in as "teacher" And I follow "Course 1" And I turn editing mode on diff --git a/mod/lesson/tests/behat/completion_condition_end_reached.feature b/mod/lesson/tests/behat/completion_condition_end_reached.feature index ac44d5b9278..e926a9a41be 100644 --- a/mod/lesson/tests/behat/completion_condition_end_reached.feature +++ b/mod/lesson/tests/behat/completion_condition_end_reached.feature @@ -16,8 +16,6 @@ Feature: Set end of lesson reached as a completion condition for a lesson | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "teacher1" And I follow "Course 1" And I turn editing mode on diff --git a/mod/lesson/tests/behat/completion_condition_time_spent.feature b/mod/lesson/tests/behat/completion_condition_time_spent.feature index 821b152b9c1..920709acc10 100644 --- a/mod/lesson/tests/behat/completion_condition_time_spent.feature +++ b/mod/lesson/tests/behat/completion_condition_time_spent.feature @@ -17,8 +17,6 @@ Feature: Set time spent as a completion condition for a lesson | user | course | role | | teacher1 | C1 | editingteacher | | student1 | C1 | student | - And the following config values are set as admin: - | enablecompletion | 1 | And I log in as "teacher1" And I follow "Course 1" And I turn editing mode on diff --git a/mod/quiz/tests/behat/completion_condition_attempts_used.feature b/mod/quiz/tests/behat/completion_condition_attempts_used.feature index 2e9ff0ae742..330606d77ce 100644 --- a/mod/quiz/tests/behat/completion_condition_attempts_used.feature +++ b/mod/quiz/tests/behat/completion_condition_attempts_used.feature @@ -17,7 +17,6 @@ Feature: Set a quiz to be marked complete when the student uses all attempts all | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following config values are set as admin: - | enablecompletion | 1 | | grade_item_advanced | hiddenuntil | And the following "question categories" exist: | contextlevel | reference | name | diff --git a/mod/quiz/tests/behat/completion_condition_passing_grade.feature b/mod/quiz/tests/behat/completion_condition_passing_grade.feature index 1d781e6fbee..3312cca1e8e 100644 --- a/mod/quiz/tests/behat/completion_condition_passing_grade.feature +++ b/mod/quiz/tests/behat/completion_condition_passing_grade.feature @@ -17,7 +17,6 @@ Feature: Set a quiz to be marked complete when the student passes | teacher1 | C1 | editingteacher | | student1 | C1 | student | And the following config values are set as admin: - | enablecompletion | 1 | | grade_item_advanced | hiddenuntil | And the following "question categories" exist: | contextlevel | reference | name |