From a0b40bd104ccfd862f9e71fcce0d64063ac7c86b Mon Sep 17 00:00:00 2001 From: Ilya Tregubov Date: Fri, 21 Apr 2023 15:03:02 +0800 Subject: [PATCH] MDL-77229 mod_lesson: Black list detailed statistics in classic Behat. The nav element to go to detailed stats page is missing in classic --- mod/lesson/tests/behat/lesson_report.feature | 23 ---------- .../lesson_report_detailed_statistics.feature | 45 +++++++++++++++++++ theme/classic/tests/behat/blacklist.json | 3 +- 3 files changed, 47 insertions(+), 24 deletions(-) create mode 100644 mod/lesson/tests/behat/lesson_report_detailed_statistics.feature diff --git a/mod/lesson/tests/behat/lesson_report.feature b/mod/lesson/tests/behat/lesson_report.feature index 869ccb89dcb..ee2b9074bc9 100644 --- a/mod/lesson/tests/behat/lesson_report.feature +++ b/mod/lesson/tests/behat/lesson_report.feature @@ -9,7 +9,6 @@ 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 | @@ -17,7 +16,6 @@ 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 | @@ -151,24 +149,3 @@ 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." diff --git a/mod/lesson/tests/behat/lesson_report_detailed_statistics.feature b/mod/lesson/tests/behat/lesson_report_detailed_statistics.feature new file mode 100644 index 00000000000..16f275ce328 --- /dev/null +++ b/mod/lesson/tests/behat/lesson_report_detailed_statistics.feature @@ -0,0 +1,45 @@ +@mod @mod_lesson +Feature: In a lesson activity, teachers can view detailed statistics report + To review detailed statistics in a lesson + As a Teacher + I need to ve able to navigate to detailed statistics report page. + + Background: + Given the following "users" exist: + | 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 | + And the following "course enrolments" exist: + | 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 | + And I am on the "Test lesson name" "lesson activity" page logged in as teacher1 + + 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." diff --git a/theme/classic/tests/behat/blacklist.json b/theme/classic/tests/behat/blacklist.json index 63f6dbf7589..edc4a37f139 100644 --- a/theme/classic/tests/behat/blacklist.json +++ b/theme/classic/tests/behat/blacklist.json @@ -11,7 +11,8 @@ "course/format/tests/behat/courseindex_keyboardnav.feature", "course/format/tests/behat/courseindex_completion.feature", "course/format/tests/behat/courseindex_language.feature", - "badges/tests/behat/badge_navigation.feature" + "badges/tests/behat/badge_navigation.feature", + "mod/lesson/tests/behat/lesson_report_detailed_statistics.feature" ], "tags": [ "addablocklink"