diff --git a/grade/report/overview/index.php b/grade/report/overview/index.php index 5fcce755556..5d496b2cbc1 100644 --- a/grade/report/overview/index.php +++ b/grade/report/overview/index.php @@ -169,7 +169,7 @@ if (has_capability('moodle/grade:viewall', $context) && $courseid != SITEID) { echo $OUTPUT->header(); if ($report->fill_table(true, true)) { - echo html_writer::tag('h3', get_string('coursesiamtaking', 'grades')); + echo $OUTPUT->heading(get_string('coursesiamtaking', 'grades')); echo '
' . $report->print_table(true); } } else { // We have a course context. We must be navigating from the gradebook. @@ -189,7 +189,7 @@ if (has_capability('moodle/grade:viewall', $context) && $courseid != SITEID) { } if (count($report->teachercourses)) { - echo html_writer::tag('h3', get_string('coursesiamteaching', 'grades')); + echo $OUTPUT->heading(get_string('coursesiamteaching', 'grades')); $report->print_teacher_table(); } diff --git a/grade/report/overview/tests/behat/view_grades.feature b/grade/report/overview/tests/behat/view_grades.feature new file mode 100644 index 00000000000..fde70e5cd52 --- /dev/null +++ b/grade/report/overview/tests/behat/view_grades.feature @@ -0,0 +1,30 @@ +@gradereport @gradereport_overview +Feature: Grade overview report can be viewed + In order to see the courses I am enrolled in + As a user + I should be able to access the grade overview report's index page + + Background: + Given the following "courses" exist: + | fullname | shortname | + | Awesome course | C1 | + And the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | t1@example.com | + | student1 | Student | 1 | s1@example.com | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + + @javascript @accessibility + Scenario Outline: The grade overview report index page should be accessible + Given I am logged in as "" + When I follow "Grades" in the user menu + Then "" "heading" should exist + And the page should meet accessibility standards with "best-practice" extra tests + + Examples: + | user | headingname | + | student1 | Courses I am taking | + | teacher1 | Courses I am teaching | diff --git a/user/tests/behat/user_grade_navigation.feature b/user/tests/behat/user_grade_navigation.feature index b4f91a94d33..58a1aa9048d 100644 --- a/user/tests/behat/user_grade_navigation.feature +++ b/user/tests/behat/user_grade_navigation.feature @@ -39,7 +39,7 @@ Feature: The student can navigate to their grades page and user grade report. Then "//img[contains(@class, 'userpicture')]" "xpath_element" should exist And I should see "Student 1" in the "h1" "css_element" # Confirm that there is a subheader text - "Courses I am taking". - And "//h3[normalize-space(.)='Courses I am taking']" "xpath_element" should exist + And "Courses I am taking" "heading" should exist # Confirm that the overview-grade table has the correct data. And the following should exist in the "overview-grade" table: | Course name | Grade |