Grade a student's submission to an assignment of the scenario's course, the way a teacher does: "Submissions", the student's "Grade", the grade typed in "Grade out of …", the feedback typed in "Feedback comments" when the step gives one, then "Save changes". The step waits for the grader to confirm the save.
Examples
When I grade "student" with "85" for the assignment "Testing diary"
When we grade "student" with "85" for the assignment "Testing diary" with the feedback "Well found."
And I grade "student" with "70" for the assignment "Testing diary"
Given I grade "student" with "100" for the assignment "Testing diary" with the feedback "A clear entry."
When we grade "student" with "55" for the assignment "Testing diary"
Pattern
When(/^(I |we )*grade "([^"]*)" with "([^"]*)" for the assignment "([^"]*)"(?: with the feedback "([^"]*)")?$/, …)
Part of @webship-js/moodle-steps (github.com/webship/moodle-steps), a step pack for Webship-js 2.0.x.