When I enrol "student2" in the course as "Student"

Enrol an account of the users registry in the scenario's course with a role, the way a teacher does: the "Enrol users" button of the participants page, the account searched for in "Select users" (by its address), the role chosen in "Assign role", and "Enrol users". The step waits until the participants table lists the account.

Examples

When I enrol "student2" in the course as "Student"
When we enrol "student2" in the course as "Non-editing teacher"
And I enrol "student2" in the course as "Student"
Given I enrol "student2" in the course as "Student"
When we enrol "student2" in the course as "Student"

Pattern

When(/^(I |we )*enrol "([^"]*)" in the course as "([^"]*)"$/, …)

Part of @webship-js/moodle-steps (github.com/webship/moodle-steps), a step pack for Webship-js 2.0.x.