From 39cb2a03e5b0281fedc1eeaaf5b8dd24de8e9404 Mon Sep 17 00:00:00 2001 From: Angelia Dela Cruz Date: Wed, 5 Jun 2024 17:11:43 +0800 Subject: [PATCH] MDL-81332 core_course: Behat test for grade and activity reports display --- .../tests/behat/course_report_display.feature | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 course/tests/behat/course_report_display.feature diff --git a/course/tests/behat/course_report_display.feature b/course/tests/behat/course_report_display.feature new file mode 100644 index 0000000000000..2a37df6153f5b --- /dev/null +++ b/course/tests/behat/course_report_display.feature @@ -0,0 +1,45 @@ +@core @core_course +Feature: Students can view their grades and activity reports + In order for students to view their grades and activity reports + As a teacher + I should be able to change the report display settings + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | student1 | Student | 1 | student1@example.com | + + Scenario Outline: Grade reports can be displayed or hidden to students + Given the following "courses" exist: + | fullname | shortname | showgrades | + | Course 1 | C1 | | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + When I am on the "student1" "user > profile" page logged in as student1 + And I click on "Course 1" "link" + Then I see "Grades overview" + + Examples: + | gradevisibility | gradelinkvisibility | + | 1 | should | + | 0 | should not | + + Scenario Outline: Activity reports can be displayed or hidden to students + Given the following "courses" exist: + | fullname | shortname | showreports | + | Course 1 | C1 | | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + When I am on the "student1" "user > profile" page logged in as student1 + And I click on "Course 1" "link" + Then I see "Today's logs" + And I see "All logs" + And I see "Outline report" + And I see "Complete report" + + Examples: + | reportvisibility | reportlinkvisibility | + | 1 | should | + | 0 | should not |