MDL-77229 lesson: Add Behat test

This commit is contained in:
Ilya Tregubov 2023-04-21 11:59:27 +08:00
parent 39084a098b
commit 6e15a26dce

View File

@ -9,6 +9,7 @@ Feature: In a lesson activity, teachers can review student attempts
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@ -16,6 +17,7 @@ Feature: In a lesson activity, teachers can review student attempts
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | course | idnumber | retake |
| lesson | Test lesson name | C1 | lesson1 | 1 |
@ -149,3 +151,24 @@ Feature: In a lesson activity, teachers can review student attempts
And I should not see "High score"
And I should not see "Average score"
And I should not see "Low score"
Scenario: View detailed statistics in a lesson when empty string is given as answer
Given I follow "Add a question page"
And I set the field "Select a question type" to "Numerical"
And I press "Add a question page"
And I set the following fields to these values:
| Page title | Numerical question |
| Page contents | What is 1 + 0.5? |
| id_answer_editor_0 | 1.5 |
| id_jumpto_0 | End of lesson |
And I press "Save page"
When I am on the "Test lesson name" "lesson activity" page logged in as student1
And I press "Submit"
And I log out
And I am on the "Test lesson name" "lesson activity" page logged in as student2
And I set the field "Your answer" to "1.5"
And I press "Submit"
And I am on the "Test lesson name" "lesson activity" page logged in as teacher1
And I navigate to "Reports" in current page administration
And I select "Detailed statistics" from the "jump" singleselect
Then I should see "50% entered this."