Fix failing Behat tests

This commit is contained in:
Mark Nelson 2021-05-28 00:32:40 +08:00
parent a68f1b9487
commit 991ef9b0e3

View file

@ -8,11 +8,9 @@ Feature: Being able to correctly display options on the certificate activity edi
And the following "users" exist: And the following "users" exist:
| username | firstname | lastname | email | | username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com | | teacher1 | Teacher | 1 | teacher1@example.com |
| manager1 | Manager | 1 | Manager1@example.com |
And the following "course enrolments" exist: And the following "course enrolments" exist:
| user | course | role | | user | course | role |
| teacher1 | C1 | editingteacher | | teacher1 | C1 | editingteacher |
| manager1 | C1 | manager |
And the following "activities" exist: And the following "activities" exist:
| activity | name | intro | course | idnumber | | activity | name | intro | course | idnumber |
| customcert | Custom certificate 1 | Custom certificate 1 intro | C1 | customcert1 | | 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 "Required minutes in course"
And I should see "Set protection" And I should see "Set protection"
Scenario: Create an activity as an Editing Teacher I can see all custom certificate options @javascript
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"
Scenario: Create an activity as an Editing Teacher without required capabilities I can't see all custom certificate options 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 log in as "admin"
And I set the following system permissions of "Teacher" role: 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 "Required minutes in course"
And I should not see "Set protection" And I should not see "Set protection"
@javascript
Scenario: Add an activity using default custom certificate options 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 am on "Course 1" course homepage with editing mode on
And I add a "Custom certificate" to section "0" And I add a "Custom certificate" to section "0"
And the field "emailstudents" matches value "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_modify" matches value "0"
And the field "protection_copy" matches value "0" And the field "protection_copy" matches value "0"
@javascript
Scenario: Add an activity using configured custom certificate options Scenario: Add an activity using configured custom certificate options
And the following config values are set as admin: And the following config values are set as admin:
| emailstudents | 1 | customcert | | emailstudents | 1 | customcert |
@ -129,7 +96,7 @@ Feature: Being able to correctly display options on the certificate activity edi
| protection_print | 1 | customcert | | protection_print | 1 | customcert |
| protection_modify | 1 | customcert | | protection_modify | 1 | customcert |
| protection_copy | 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 am on "Course 1" course homepage with editing mode on
And I add a "Custom certificate" to section "1" And I add a "Custom certificate" to section "1"
And the field "emailstudents" matches value "1" And the field "emailstudents" matches value "1"