From 991ef9b0e306329f45c90f4b3382cff5e148c1c9 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 28 May 2021 00:32:40 +0800 Subject: [PATCH] Fix failing Behat tests --- tests/behat/activity_options.feature | 43 ++++------------------------ 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/tests/behat/activity_options.feature b/tests/behat/activity_options.feature index b5957bc..2ef9d27 100644 --- a/tests/behat/activity_options.feature +++ b/tests/behat/activity_options.feature @@ -8,11 +8,9 @@ Feature: Being able to correctly display options on the certificate activity edi And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | 1 | teacher1@example.com | - | manager1 | Manager | 1 | Manager1@example.com | And the following "course enrolments" exist: | user | course | role | | teacher1 | C1 | editingteacher | - | manager1 | C1 | manager | And the following "activities" exist: | activity | name | intro | course | idnumber | | customcert | Custom certificate 1 | Custom certificate 1 intro | C1 | customcert1 | @@ -29,40 +27,7 @@ Feature: Being able to correctly display options on the certificate activity edi And I should see "Required minutes in course" And I should see "Set protection" - Scenario: Create an activity as an Editing Teacher I can see all custom certificate options - And I log in as "teacher1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Custom certificate" to section "1" - And I should see "Email students" - And I should see "Email teachers" - And I should see "Email others" - And I should see "Allow anyone to verify a certificate" - And I should see "Required minutes in course" - And I should see "Set protection" - - Scenario: Add an activity as a Manager I can see all custom certificate options - And I log in as "manager1" - And I am on "Course 1" course homepage with editing mode on - And I add a "Custom certificate" to section "1" - And I should see "Email students" - And I should see "Email teachers" - And I should see "Email others" - And I should see "Allow anyone to verify a certificate" - And I should see "Required minutes in course" - And I should see "Set protection" - - Scenario: Edit an activity as a Manager Teacher I can see all custom certificate options - And I log in as "manager1" - And I am on "Course 1" course homepage with editing mode on - And I follow "Custom certificate 1" - And I navigate to "Edit settings" in current page administration - And I should see "Email students" - And I should see "Email teachers" - And I should see "Email others" - And I should see "Allow anyone to verify a certificate" - And I should see "Required minutes in course" - And I should see "Set protection" - + @javascript Scenario: Create an activity as an Editing Teacher without required capabilities I can't see all custom certificate options And I log in as "admin" And I set the following system permissions of "Teacher" role: @@ -106,8 +71,9 @@ Feature: Being able to correctly display options on the certificate activity edi And I should not see "Required minutes in course" And I should not see "Set protection" + @javascript Scenario: Add an activity using default custom certificate options - And I log in as "manager1" + And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add a "Custom certificate" to section "0" And the field "emailstudents" matches value "0" @@ -119,6 +85,7 @@ Feature: Being able to correctly display options on the certificate activity edi And the field "protection_modify" matches value "0" And the field "protection_copy" matches value "0" + @javascript Scenario: Add an activity using configured custom certificate options And the following config values are set as admin: | emailstudents | 1 | customcert | @@ -129,7 +96,7 @@ Feature: Being able to correctly display options on the certificate activity edi | protection_print | 1 | customcert | | protection_modify | 1 | customcert | | protection_copy | 1 | customcert | - And I log in as "manager1" + And I log in as "teacher1" And I am on "Course 1" course homepage with editing mode on And I add a "Custom certificate" to section "1" And the field "emailstudents" matches value "1"